From 0fd6fcd21ebc705672ac2c24d0ea161338d7c724 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Wed, 18 Sep 2024 21:58:00 +0200 Subject: [PATCH 01/41] WebExtension installation --- index.bs | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/index.bs b/index.bs index b20be95e..e4bf4b28 100644 --- a/index.bs +++ b/index.bs @@ -1597,6 +1597,7 @@ session.CapabilityRequest = { ? platformName: text, ? proxy: session.ProxyConfiguration, ? unhandledPromptBehavior: session.UserPromptHandler, + ? extensions: [*session.Extension], Extensible }; @@ -1727,6 +1728,31 @@ session.SubscriptionRequest = { The session.SubscriptionRequest type represents a request to subscribe to or unsubscribe from a specific set of events. +#### The session.Extension Type #### {#type-session-Extension} + +
+Extension = text
+
+ +The Extension type is base64 encoded web-extension archive (xpi/crx/zip), +an absolute path to the web-extension archive or absolute path to the unpacked web-extension. + +
+ExtensionDetails = {
+   extension: Extension,
+   ? installTemporary: bool .default true
+   ? allowPrivateBrowsing: bool .default false
+}
+
+ +The ExtensionDetails type represents a web-extension with its additional properties. + +
+session.Extension = Extension / ExtensionDetails
+
+ +The session.Extension type represents a web-extension to run in the session. + ### Commands ### {#module-session-commands} #### The session.status Command #### {#command-session-status} @@ -2010,6 +2036,68 @@ The [=remote end steps=] with |session| and |command parameters| are: +#### The session.installWebExtension Command #### {#command-session-installWebExtension} + +The session.installWebExtension command installs +a web-extension for a given session. + +
+
Command Type
+
+
+     session.InstallWebExtension = (
+       method: "session.installWebExtension",
+       params: session.InstallWebExtensionParameters
+     )
+
+     session.InstallWebExtensionParameters = {
+       extension: session.Extension
+     }
+     
+
+
Result Type
+
+
+      session.InstallWebExtensionResult = (
+        script.InstallWebExtensionSuccess /
+        script.InstallWebExtensionException
+      )
+
+      session.InstallWebExtensionSuccess = {
+        type: "success",
+        webExtensionId: text
+      }
+
+      session.InstallWebExtensionException = {
+        type: "exception",
+        exceptionDetails: text
+      }
+      
+
+
+ +
+The [=remote end steps=] with |session| and |command parameters| are: + +1. Let the |extension| be the value of the extension field of + |command parameters|. + +1. [=Try=] to install web-extension with |session| and |extension|. + +1. If exception is throw + + 1. Let |exception details| be the exception message. + + 1. Return a new [=/map=] matching the session.InstallWebExtensionException + production, with the exceptionDetails field set to + |exception details|. + + +1. Return a new map matching the session.InstallWebExtensionSuccess production, with + the webExtensionId field set to the web-extension id. + +
+ ## The browser Module ## {#module-browser} The browser module contains commands for From e051e81c9421e243d79dc78c7555cc880cb4fab0 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Wed, 2 Oct 2024 20:55:35 +0200 Subject: [PATCH 02/41] Reorganise into Extension module --- index.bs | 233 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 145 insertions(+), 88 deletions(-) diff --git a/index.bs b/index.bs index e4bf4b28..c984089e 100644 --- a/index.bs +++ b/index.bs @@ -603,6 +603,9 @@ WebDriver BiDi extends the set of [=error codes=] from [[WEBDRIVER|WebDriver]] with the following additional codes:
+
invalid extension +
Tried to install invalid extension. +
no such client window
Tried to interact with an unknown [=client window=]. @@ -645,6 +648,7 @@ with the following additional codes:
 ErrorCode = "invalid argument" /
+            "invalid extension" /
             "invalid selector" /
             "invalid session id" /
             "move target out of bounds" /
@@ -1597,7 +1601,6 @@ session.CapabilityRequest = {
   ? platformName: text,
   ? proxy: session.ProxyConfiguration,
   ? unhandledPromptBehavior: session.UserPromptHandler,
-  ? extensions: [*session.Extension],
   Extensible
 };
 
@@ -1728,31 +1731,6 @@ session.SubscriptionRequest = { The session.SubscriptionRequest type represents a request to subscribe to or unsubscribe from a specific set of events. -#### The session.Extension Type #### {#type-session-Extension} - -
-Extension = text
-
- -The Extension type is base64 encoded web-extension archive (xpi/crx/zip), -an absolute path to the web-extension archive or absolute path to the unpacked web-extension. - -
-ExtensionDetails = {
-   extension: Extension,
-   ? installTemporary: bool .default true
-   ? allowPrivateBrowsing: bool .default false
-}
-
- -The ExtensionDetails type represents a web-extension with its additional properties. - -
-session.Extension = Extension / ExtensionDetails
-
- -The session.Extension type represents a web-extension to run in the session. - ### Commands ### {#module-session-commands} #### The session.status Command #### {#command-session-status} @@ -2036,68 +2014,6 @@ The [=remote end steps=] with |session| and |command parameters| are: -#### The session.installWebExtension Command #### {#command-session-installWebExtension} - -The session.installWebExtension command installs -a web-extension for a given session. - -
-
Command Type
-
-
-     session.InstallWebExtension = (
-       method: "session.installWebExtension",
-       params: session.InstallWebExtensionParameters
-     )
-
-     session.InstallWebExtensionParameters = {
-       extension: session.Extension
-     }
-     
-
-
Result Type
-
-
-      session.InstallWebExtensionResult = (
-        script.InstallWebExtensionSuccess /
-        script.InstallWebExtensionException
-      )
-
-      session.InstallWebExtensionSuccess = {
-        type: "success",
-        webExtensionId: text
-      }
-
-      session.InstallWebExtensionException = {
-        type: "exception",
-        exceptionDetails: text
-      }
-      
-
-
- -
-The [=remote end steps=] with |session| and |command parameters| are: - -1. Let the |extension| be the value of the extension field of - |command parameters|. - -1. [=Try=] to install web-extension with |session| and |extension|. - -1. If exception is throw - - 1. Let |exception details| be the exception message. - - 1. Return a new [=/map=] matching the session.InstallWebExtensionException - production, with the exceptionDetails field set to - |exception details|. - - -1. Return a new map matching the session.InstallWebExtensionSuccess production, with - the webExtensionId field set to the web-extension id. - -
- ## The browser Module ## {#module-browser} The browser module contains commands for @@ -11434,6 +11350,147 @@ The [=remote end steps=] given |session| and |command parameters| are: +## The extensions Module ## {#module-extensions} + +The extensions module contains functionality for +managing and interacting with extensions. + +### Definition ### {#module-extensions-definition} + +[=remote end definition=] + +
+ExtensionsCommand = (
+  extensions.Install
+)
+
+ +[=local end definition=] + +
+ExtensionsResult = (
+  extensions.InstallResult
+)
+
+ +### Types ### {#module-extensions-types} + +#### The extensions.Extension Type #### {#type-extensions-Extension} + +
+extensions.ExtensionArchive = {
+   files: [+text],
+}
+
+ +
+extensions.Extension = {
+   installPath: extensions.ExtensionPath / extensions.ExtensionArchivePath / extensions.ExtensionBase64Encoded,
+   ? allowPrivateBrowsing: bool .default false,
+}
+
+extensions.ExtensionPath = {
+   type: "path",
+   path: text,
+}
+
+extensions.ExtensionArchivePath = {
+   type: "archive-path",
+   path: text,
+}
+
+extensions.ExtensionBase64Encoded = {
+   type: "base64",
+   value: text,
+}
+
+ +The extensions.Extension type represents an extension with its additional properties. + +
+To expand a install path spec given |install path spec|: + +1. Let |path| be a value of path field of |install path spec| if the value of type of the |install path spec| is equal to path, + otherwise perform any implementation-defined steps to create a temporary folder and make its path to be the value of |path|. + +1. Let |archive path| be a value of path field of |install path spec| if the value of type of the |install path spec| is equal to archive-path, + otherwise if the value of type of the |install path spec| is equal to archive-path perform any implementation-defined steps to create a temporary file + being a result of Base64 decodeing of the value of value filed of |install path spec| and make its path to be the value of |archive path|, + otherwise |archive path| is null. + +1. If |archive path| if not null: + + 1. Perform any implementation-defined steps to unpack archive into |path|. + +1. Let |extension files| be a result of implementation-defined steps to list all paths in |path| folder. + +1. Let |extension archive| be a map matching the extensions.ExtensionArchive production, with the files field set to |extension files|. + +1. Return [=success=] with data |extension archive|. + +
+ +### Commands ### {#module-extensions-commands} + +#### The extensions.install Command #### {#command-extensions-install} + +The extensions.install command installs an extension for the session. + +
+
Command Type
+
+
+     extensions.Install = (
+       method: "extensions.install",
+       params: extensions.InstallParameters
+     )
+
+     extensions.InstallParameters = {
+       extension: extensions.Extension,
+     }
+     
+
+
Result Type
+
+
+      extensions.InstallResult = (
+        extensionId: text
+      )
+      
+
+
+ +
+The [=remote end steps=] with |session| and |command parameters| are: + +1. Let the |extension| be the value of the extension field of |command parameters| + +1. If installing |extension| isn't supported return [=error=] with error code [=unsupported operation=]. + +1. Let |install path spec| be a value of installPath field of the |extension|. + +1. Let |extension archive| be the result of [=trying=] to [=expand a install path spec=] with |install path spec|. + +1. Let |extension files| be a value of files field of |extension archive|. + +1. If |extension files| does not include entry manifest.json return [=error=] with code [=invalid extension=] + +1. Perform any implementation-defined steps to install the extension into |session|. + +1. Let |extension id| be a unique identifier of the |extension| for the browser decided by the implementation-defined steps. + +1. Let |allow private browsing| be a value of allowPrivateBrowsing field of |command parameters| if present, or false otherwise. + +1. Perform any implementation-defined steps to enable extension to be run in private browsing based on the valu of |allow private browsing|. + +1. Let |result| be a [=/map=] matching the + extensions.InstallResult production with the + extensionId field set to |extension id|. + +1. Return [=success=] with data |result|. + +
+ # Patches to Other Specifications # {#patches} This specification requires some changes to external specifications to provide the necessary From a541d6c44136cd1eb406ccd048a52094766e8a65 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras <1228153+chrmod@users.noreply.github.com> Date: Tue, 8 Oct 2024 21:14:38 +0200 Subject: [PATCH 03/41] Update index.bs Co-authored-by: Oliver Dunk --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index c984089e..4907e2a8 100644 --- a/index.bs +++ b/index.bs @@ -11481,7 +11481,7 @@ The [=remote end steps=] with |session| and |command parameters| are: 1. Let |allow private browsing| be a value of allowPrivateBrowsing field of |command parameters| if present, or false otherwise. -1. Perform any implementation-defined steps to enable extension to be run in private browsing based on the valu of |allow private browsing|. +1. Perform any implementation-defined steps to enable extension to be run in private browsing based on the value of |allow private browsing|. 1. Let |result| be a [=/map=] matching the extensions.InstallResult production with the From 064f4d28ffd1458272a4e100480f74fc89c41c3e Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Tue, 8 Oct 2024 21:37:53 +0200 Subject: [PATCH 04/41] Simplify expand a install path spec --- index.bs | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/index.bs b/index.bs index 4907e2a8..c15f35ef 100644 --- a/index.bs +++ b/index.bs @@ -11410,17 +11410,23 @@ The extensions.Extension type represents an extension with its addi
To expand a install path spec given |install path spec|: -1. Let |path| be a value of path field of |install path spec| if the value of type of the |install path spec| is equal to path, - otherwise perform any implementation-defined steps to create a temporary folder and make its path to be the value of |path|. +1. Switch on the value of the type field of |install path spec|: -1. Let |archive path| be a value of path field of |install path spec| if the value of type of the |install path spec| is equal to archive-path, - otherwise if the value of type of the |install path spec| is equal to archive-path perform any implementation-defined steps to create a temporary file - being a result of Base64 decodeing of the value of value filed of |install path spec| and make its path to be the value of |archive path|, - otherwise |archive path| is null. +
+
"path" +
Let |path| be a value of path field of |install path spec|. -1. If |archive path| if not null: +
"archive-path" +
+ 1. Let |archive path| be a value of path field of |install path spec|. + 1. Perform any implementation-defined steps to extract the archive from archive path to a temporary directory and let |path| be the path to that temporary directory. - 1. Perform any implementation-defined steps to unpack archive into |path|. +
"base64" +
+ 1. Let |archive path| be a value of path field of |install path spec|. + 1. Perform any implementation-defined steps to decode archive path to a zip archive and extract that archive to a temporary directory and let |path| be the path to that temporary directory. + +
1. Let |extension files| be a result of implementation-defined steps to list all paths in |path| folder. From d5d88a674667489357840bc3328c443f00d88fa3 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Wed, 9 Oct 2024 21:39:42 +0200 Subject: [PATCH 05/41] fixing InstallResult type definition --- index.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index c15f35ef..a5929ae2 100644 --- a/index.bs +++ b/index.bs @@ -11459,9 +11459,9 @@ The extensions.install command installs an extens
Result Type
-      extensions.InstallResult = (
+      extensions.InstallResult = {
         extensionId: text
-      )
+      }
       
From 5f8b9d8c196768345b5bad7aae58bbf9c380a236 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Fri, 11 Oct 2024 13:35:30 +0200 Subject: [PATCH 06/41] Rename module to WebExtensions --- index.bs | 64 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/index.bs b/index.bs index a5929ae2..12d83001 100644 --- a/index.bs +++ b/index.bs @@ -603,8 +603,8 @@ WebDriver BiDi extends the set of [=error codes=] from [[WEBDRIVER|WebDriver]] with the following additional codes:
-
invalid extension -
Tried to install invalid extension. +
invalid web-extension +
Tried to install invalid a web-extension.
no such client window
Tried to interact with an unknown [=client window=]. @@ -648,7 +648,7 @@ with the following additional codes:
 ErrorCode = "invalid argument" /
-            "invalid extension" /
+            "invalid web-extension" /
             "invalid selector" /
             "invalid session id" /
             "move target out of bounds" /
@@ -11350,62 +11350,62 @@ The [=remote end steps=] given |session| and |command parameters| are:
 
 
 
-## The extensions Module ## {#module-extensions}
+## The webExtensions Module ## {#module-webExtensions}
 
-The extensions module contains functionality for
-managing and interacting with extensions.
+The webExtensions module contains functionality for
+managing and interacting with web-extensions.
 
-### Definition ### {#module-extensions-definition}
+### Definition ### {#module-webExtensions-definition}
 
 [=remote end definition=]
 
 
-ExtensionsCommand = (
-  extensions.Install
+WebExtensionsCommand = (
+  webExtensions.Install
 )
 
[=local end definition=]
-ExtensionsResult = (
-  extensions.InstallResult
+WebExtensionsResult = (
+  webExtensions.InstallResult
 )
 
-### Types ### {#module-extensions-types} +### Types ### {#module-webExtensions-types} -#### The extensions.Extension Type #### {#type-extensions-Extension} +#### The extensions.Extension Type #### {#type-webExtensions-Extension}
-extensions.ExtensionArchive = {
+webExtensions.ExtensionArchive = {
    files: [+text],
 }
 
-extensions.Extension = {
-   installPath: extensions.ExtensionPath / extensions.ExtensionArchivePath / extensions.ExtensionBase64Encoded,
+webExtensions.Extension = {
+   installPath: webExtensions.ExtensionPath / webExtensions.ExtensionArchivePath / webExtensions.ExtensionBase64Encoded,
    ? allowPrivateBrowsing: bool .default false,
 }
 
-extensions.ExtensionPath = {
+webExtensions.ExtensionPath = {
    type: "path",
    path: text,
 }
 
-extensions.ExtensionArchivePath = {
+webExtensions.ExtensionArchivePath = {
    type: "archive-path",
    path: text,
 }
 
-extensions.ExtensionBase64Encoded = {
+webExtensions.ExtensionBase64Encoded = {
    type: "base64",
    value: text,
 }
 
-The extensions.Extension type represents an extension with its additional properties. +The webExtensions.Extension type represents an extension with its additional properties.
To expand a install path spec given |install path spec|: @@ -11430,7 +11430,7 @@ To expand a install path spec given |install path spec|: 1. Let |extension files| be a result of implementation-defined steps to list all paths in |path| folder. -1. Let |extension archive| be a map matching the extensions.ExtensionArchive production, with the files field set to |extension files|. +1. Let |extension archive| be a map matching the webExtensions.ExtensionArchive production, with the files field set to |extension files|. 1. Return [=success=] with data |extension archive|. @@ -11438,35 +11438,35 @@ To expand a install path spec given |install path spec|: ### Commands ### {#module-extensions-commands} -#### The extensions.install Command #### {#command-extensions-install} +#### The webExtensions.install Command #### {#command-extensions-install} -The extensions.install command installs an extension for the session. +The webExtensions.install command installs an extension for the session.
Command Type
-     extensions.Install = (
-       method: "extensions.install",
-       params: extensions.InstallParameters
+     webExtensions.Install = (
+       method: "webExtensions.install",
+       params: webExtensions.InstallParameters
      )
 
-     extensions.InstallParameters = {
-       extension: extensions.Extension,
+     webExtensions.InstallParameters = {
+       extension: webExtensions.Extension,
      }
      
Result Type
-      extensions.InstallResult = {
+      webExtensions.InstallResult = {
         extensionId: text
       }
       
-
+
The [=remote end steps=] with |session| and |command parameters| are: 1. Let the |extension| be the value of the extension field of |command parameters| @@ -11479,7 +11479,7 @@ The [=remote end steps=] with |session| and |command parameters| are: 1. Let |extension files| be a value of files field of |extension archive|. -1. If |extension files| does not include entry manifest.json return [=error=] with code [=invalid extension=] +1. If |extension files| does not include entry manifest.json return [=error=] with code [=invalid web-extension=] 1. Perform any implementation-defined steps to install the extension into |session|. @@ -11490,7 +11490,7 @@ The [=remote end steps=] with |session| and |command parameters| are: 1. Perform any implementation-defined steps to enable extension to be run in private browsing based on the value of |allow private browsing|. 1. Let |result| be a [=/map=] matching the - extensions.InstallResult production with the + webExtensions.InstallResult production with the extensionId field set to |extension id|. 1. Return [=success=] with data |result|. From fb1ec9b9988c5a759a5313ff1b62177e1361630f Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Fri, 11 Oct 2024 13:55:32 +0200 Subject: [PATCH 07/41] Remove Extension wrapper type --- index.bs | 75 ++++++++++++++++++++++++++------------------------------ 1 file changed, 35 insertions(+), 40 deletions(-) diff --git a/index.bs b/index.bs index 12d83001..2b9f3a3d 100644 --- a/index.bs +++ b/index.bs @@ -11383,47 +11383,28 @@ webExtensions.ExtensionArchive = { }
-
-webExtensions.Extension = {
-   installPath: webExtensions.ExtensionPath / webExtensions.ExtensionArchivePath / webExtensions.ExtensionBase64Encoded,
-   ? allowPrivateBrowsing: bool .default false,
-}
+
+To expand a extension data spec given |extension data spec|: -webExtensions.ExtensionPath = { - type: "path", - path: text, -} -webExtensions.ExtensionArchivePath = { - type: "archive-path", - path: text, -} +1. Let |installation type| be a value of type field of |extension data spec|. -webExtensions.ExtensionBase64Encoded = { - type: "base64", - value: text, -} -
- -The webExtensions.Extension type represents an extension with its additional properties. - -
-To expand a install path spec given |install path spec|: +1. If installing |installation type| isn't supported return [=error=] with error code [=unsupported operation=]. -1. Switch on the value of the type field of |install path spec|: +1. Switch on the value of the installation type:
"path" -
Let |path| be a value of path field of |install path spec|. +
Let |path| be a value of path field of |extension data spec|.
"archive-path"
- 1. Let |archive path| be a value of path field of |install path spec|. + 1. Let |archive path| be a value of path field of |extension data spec|. 1. Perform any implementation-defined steps to extract the archive from archive path to a temporary directory and let |path| be the path to that temporary directory.
"base64"
- 1. Let |archive path| be a value of path field of |install path spec|. + 1. Let |archive path| be a value of path field of |extension data spec|. 1. Perform any implementation-defined steps to decode archive path to a zip archive and extract that archive to a temporary directory and let |path| be the path to that temporary directory.
@@ -11445,16 +11426,32 @@ The webExtensions.install command installs an ext
Command Type
-
-     webExtensions.Install = (
-       method: "webExtensions.install",
-       params: webExtensions.InstallParameters
-     )
+      
+      webExtensions.Install = (
+         method: "webExtensions.install",
+         params: webExtensions.InstallParameters
+      )
 
-     webExtensions.InstallParameters = {
-       extension: webExtensions.Extension,
-     }
-     
+ webExtensions.InstallParameters = { + extensionData: webExtensions.ExtensionPath / webExtensions.ExtensionArchivePath / webExtensions.ExtensionBase64Encoded, + ? allowPrivateBrowsing: bool .default false, + } + + webExtensions.ExtensionPath = { + type: "path", + path: text, + } + + webExtensions.ExtensionArchivePath = { + type: "archive-path", + path: text, + } + + webExtensions.ExtensionBase64Encoded = { + type: "base64", + value: text, + } +
Result Type
@@ -11469,13 +11466,11 @@ The webExtensions.install command installs an ext
The [=remote end steps=] with |session| and |command parameters| are: -1. Let the |extension| be the value of the extension field of |command parameters| - 1. If installing |extension| isn't supported return [=error=] with error code [=unsupported operation=]. -1. Let |install path spec| be a value of installPath field of the |extension|. +1. Let |extension data spec| be a value of extensionData field of the |command parameters|. -1. Let |extension archive| be the result of [=trying=] to [=expand a install path spec=] with |install path spec|. +1. Let |extension archive| be the result of [=trying=] to [=expand a extension data spec=] with |extension data spec|. 1. Let |extension files| be a value of files field of |extension archive|. From 66d024d25009840b2a2a43cf1151641c63879370 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Fri, 11 Oct 2024 14:46:53 +0200 Subject: [PATCH 08/41] Fix typo --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index 2b9f3a3d..5c9e6955 100644 --- a/index.bs +++ b/index.bs @@ -11472,7 +11472,7 @@ The [=remote end steps=] with |session| and |command parameters| are: 1. Let |extension archive| be the result of [=trying=] to [=expand a extension data spec=] with |extension data spec|. -1. Let |extension files| be a value of files field of |extension archive|. +1. Let |extension files| be a value of files field of |extension archive|. 1. If |extension files| does not include entry manifest.json return [=error=] with code [=invalid web-extension=] From 4b54f21120b7beda7386191e7ea1f2c93a361ba7 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Fri, 11 Oct 2024 16:39:24 +0200 Subject: [PATCH 09/41] Rename extensionId --- index.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index 5c9e6955..032891d0 100644 --- a/index.bs +++ b/index.bs @@ -11457,7 +11457,7 @@ The webExtensions.install command installs an ext
       webExtensions.InstallResult = {
-        extensionId: text
+        extension: text
       }
       
@@ -11486,7 +11486,7 @@ The [=remote end steps=] with |session| and |command parameters| are: 1. Let |result| be a [=/map=] matching the webExtensions.InstallResult production with the - extensionId field set to |extension id|. + extension field set to |extension id|. 1. Return [=success=] with data |result|. From 59e797976396666835d2465474e67910ccfb0241 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Fri, 11 Oct 2024 16:51:08 +0200 Subject: [PATCH 10/41] Better error handing --- index.bs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/index.bs b/index.bs index 032891d0..ebfc8ba7 100644 --- a/index.bs +++ b/index.bs @@ -11474,11 +11474,9 @@ The [=remote end steps=] with |session| and |command parameters| are: 1. Let |extension files| be a value of files field of |extension archive|. -1. If |extension files| does not include entry manifest.json return [=error=] with code [=invalid web-extension=] +1. If |extension files| does not include entry manifest.json return [=error=] with code [=invalid web-extension=]. -1. Perform any implementation-defined steps to install the extension into |session|. - -1. Let |extension id| be a unique identifier of the |extension| for the browser decided by the implementation-defined steps. +1. Perform implementation defined steps to install |extension|. If this fails, return [=error=] with [=error code=] [=invalid extension=]. Otherwise let |extension id| be the unique identifier of the newly installed extension. 1. Let |allow private browsing| be a value of allowPrivateBrowsing field of |command parameters| if present, or false otherwise. From 990dc7bf270171c9c8666803a39143f3211075b3 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Fri, 11 Oct 2024 17:08:34 +0200 Subject: [PATCH 11/41] addressing PR comments --- index.bs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/index.bs b/index.bs index ebfc8ba7..f832d5d7 100644 --- a/index.bs +++ b/index.bs @@ -11386,7 +11386,6 @@ webExtensions.ExtensionArchive = {
To expand a extension data spec given |extension data spec|: - 1. Let |installation type| be a value of type field of |extension data spec|. 1. If installing |installation type| isn't supported return [=error=] with error code [=unsupported operation=]. @@ -11400,12 +11399,13 @@ To expand a extension data spec given |extension data spec|:
"archive-path"
1. Let |archive path| be a value of path field of |extension data spec|. - 1. Perform any implementation-defined steps to extract the archive from archive path to a temporary directory and let |path| be the path to that temporary directory. + 1. Perform any implementation-defined steps to extract ZIP from |archive path|, if this fails return [=error=] with [=error code=] [=invalid web-extension=].
"base64"
1. Let |archive path| be a value of path field of |extension data spec|. - 1. Perform any implementation-defined steps to decode archive path to a zip archive and extract that archive to a temporary directory and let |path| be the path to that temporary directory. + 1. Let |bytes| be [=for giving-base64 decode=] |extension data spec|["path"]. + 1. Perform any implementation-defined steps to extract ZIP from |bytes|, if this fails return [=error=] with [=error code=] [=invalid web-extension=].
@@ -11466,7 +11466,7 @@ The webExtensions.install command installs an ext
The [=remote end steps=] with |session| and |command parameters| are: -1. If installing |extension| isn't supported return [=error=] with error code [=unsupported operation=]. +1. If installing extensions isn't supported return [=error=] with error code [=unsupported operation=]. 1. Let |extension data spec| be a value of extensionData field of the |command parameters|. @@ -11474,9 +11474,9 @@ The [=remote end steps=] with |session| and |command parameters| are: 1. Let |extension files| be a value of files field of |extension archive|. -1. If |extension files| does not include entry manifest.json return [=error=] with code [=invalid web-extension=]. +1. If |extension files| does not include entry manifest.json return [=error=] with [=error code=] [=invalid web-extension=]. -1. Perform implementation defined steps to install |extension|. If this fails, return [=error=] with [=error code=] [=invalid extension=]. Otherwise let |extension id| be the unique identifier of the newly installed extension. +1. Perform implementation defined steps to install |extension archive|. If this fails, return [=error=] with [=error code=] [=invalid extension=]. Otherwise let |extension id| be the unique identifier of the newly installed extension. 1. Let |allow private browsing| be a value of allowPrivateBrowsing field of |command parameters| if present, or false otherwise. From 6c19ea12d7bd1301ddfbe834ab2fa19ef799e9de Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Fri, 11 Oct 2024 17:17:34 +0200 Subject: [PATCH 12/41] Use directory-entry instead of the ExtesnionArchive --- index.bs | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/index.bs b/index.bs index f832d5d7..b1a61dfc 100644 --- a/index.bs +++ b/index.bs @@ -11377,12 +11377,6 @@ WebExtensionsResult = ( #### The extensions.Extension Type #### {#type-webExtensions-Extension} -
-webExtensions.ExtensionArchive = {
-   files: [+text],
-}
-
-
To expand a extension data spec given |extension data spec|: @@ -11394,26 +11388,24 @@ To expand a extension data spec given |extension data spec|:
"path" -
Let |path| be a value of path field of |extension data spec|. +
+ 1. Let |path| be a value of path field of |extension data spec|. + 1. Let |entry| be a [=directory entry=] represeting the directory with that |path|.
"archive-path"
1. Let |archive path| be a value of path field of |extension data spec|. - 1. Perform any implementation-defined steps to extract ZIP from |archive path|, if this fails return [=error=] with [=error code=] [=invalid web-extension=]. + 1. Perform any implementation-defined steps to extract ZIP from |archive path| and let |entry| by a [=directory entry=] representing the extraction result, if this fails return [=error=] with [=error code=] [=invalid web-extension=].
"base64"
1. Let |archive path| be a value of path field of |extension data spec|. 1. Let |bytes| be [=for giving-base64 decode=] |extension data spec|["path"]. - 1. Perform any implementation-defined steps to extract ZIP from |bytes|, if this fails return [=error=] with [=error code=] [=invalid web-extension=]. + 1. Perform any implementation-defined steps to extract ZIP from |bytes| and let |entry| by a [=directory entry=] representing the extraction result, if this fails return [=error=] with [=error code=] [=invalid web-extension=].
-1. Let |extension files| be a result of implementation-defined steps to list all paths in |path| folder. - -1. Let |extension archive| be a map matching the webExtensions.ExtensionArchive production, with the files field set to |extension files|. - -1. Return [=success=] with data |extension archive|. +1. Return [=success=] with data |entry|.
@@ -11470,13 +11462,11 @@ The [=remote end steps=] with |session| and |command parameters| are: 1. Let |extension data spec| be a value of extensionData field of the |command parameters|. -1. Let |extension archive| be the result of [=trying=] to [=expand a extension data spec=] with |extension data spec|. - -1. Let |extension files| be a value of files field of |extension archive|. +1. Let |extension directory entry| be the result of [=trying=] to [=expand a extension data spec=] with |extension data spec|. -1. If |extension files| does not include entry manifest.json return [=error=] with [=error code=] [=invalid web-extension=]. +1. If |extension directory entry| does not include file manifest.json return [=error=] with [=error code=] [=invalid web-extension=]. -1. Perform implementation defined steps to install |extension archive|. If this fails, return [=error=] with [=error code=] [=invalid extension=]. Otherwise let |extension id| be the unique identifier of the newly installed extension. +1. Perform implementation defined steps to install |extension directory entry|. If this fails, return [=error=] with [=error code=] [=invalid extension=]. Otherwise let |extension id| be the unique identifier of the newly installed extension. 1. Let |allow private browsing| be a value of allowPrivateBrowsing field of |command parameters| if present, or false otherwise. From aef6deab5740e5fda5190c8c5449cb9a0e8b245d Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Fri, 11 Oct 2024 17:23:30 +0200 Subject: [PATCH 13/41] Cleanup --- index.bs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.bs b/index.bs index b1a61dfc..293502b0 100644 --- a/index.bs +++ b/index.bs @@ -11382,7 +11382,7 @@ To expand a extension data spec given |extension data spec|: 1. Let |installation type| be a value of type field of |extension data spec|. -1. If installing |installation type| isn't supported return [=error=] with error code [=unsupported operation=]. +1. If installing |installation type| isn't supported return [=error=] with [=error code=] [=unsupported operation=]. 1. Switch on the value of the installation type: @@ -11400,7 +11400,7 @@ To expand a extension data spec given |extension data spec|:
"base64"
1. Let |archive path| be a value of path field of |extension data spec|. - 1. Let |bytes| be [=for giving-base64 decode=] |extension data spec|["path"]. + 1. Let |bytes| be [=forgiving-base64 decode=] |extension data spec|["path"]. 1. Perform any implementation-defined steps to extract ZIP from |bytes| and let |entry| by a [=directory entry=] representing the extraction result, if this fails return [=error=] with [=error code=] [=invalid web-extension=].
@@ -11456,7 +11456,7 @@ The webExtensions.install command installs an ext
-The [=remote end steps=] with |session| and |command parameters| are: +The [=remote end steps=] with |command parameters| are: 1. If installing extensions isn't supported return [=error=] with error code [=unsupported operation=]. @@ -11466,7 +11466,7 @@ The [=remote end steps=] with |session| and |command parameters| are: 1. If |extension directory entry| does not include file manifest.json return [=error=] with [=error code=] [=invalid web-extension=]. -1. Perform implementation defined steps to install |extension directory entry|. If this fails, return [=error=] with [=error code=] [=invalid extension=]. Otherwise let |extension id| be the unique identifier of the newly installed extension. +1. Perform implementation defined steps to install |extension directory entry|. If this fails, return [=error=] with [=error code=] [=invalid web-extension=]. Otherwise let |extension id| be the unique identifier of the newly installed extension. 1. Let |allow private browsing| be a value of allowPrivateBrowsing field of |command parameters| if present, or false otherwise. From 1b52bf003a5b3cf1109d5cebd08c7ae16374772e Mon Sep 17 00:00:00 2001 From: Krzysztof Modras <1228153+chrmod@users.noreply.github.com> Date: Tue, 22 Oct 2024 20:55:02 +0200 Subject: [PATCH 14/41] Update index.bs Co-authored-by: Henrik Skupin --- index.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index 293502b0..80db0fba 100644 --- a/index.bs +++ b/index.bs @@ -603,8 +603,8 @@ WebDriver BiDi extends the set of [=error codes=] from [[WEBDRIVER|WebDriver]] with the following additional codes:
-
invalid web-extension -
Tried to install invalid a web-extension. +
invalid web extension +
Tried to install invalid a web extension.
no such client window
Tried to interact with an unknown [=client window=]. From ca0a49abefa74dcd34ed714f1b79941844955c92 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras <1228153+chrmod@users.noreply.github.com> Date: Tue, 22 Oct 2024 20:55:31 +0200 Subject: [PATCH 15/41] Update index.bs Co-authored-by: Henrik Skupin --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index 80db0fba..8174f065 100644 --- a/index.bs +++ b/index.bs @@ -11350,7 +11350,7 @@ The [=remote end steps=] given |session| and |command parameters| are:
-## The webExtensions Module ## {#module-webExtensions} +## The webExtension Module ## {#module-webExtension} The webExtensions module contains functionality for managing and interacting with web-extensions. From bbd12084e011910cabc51ed3bfc52760f5d56ba1 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras <1228153+chrmod@users.noreply.github.com> Date: Tue, 22 Oct 2024 20:56:03 +0200 Subject: [PATCH 16/41] Update index.bs Co-authored-by: Henrik Skupin --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index 8174f065..2fb03078 100644 --- a/index.bs +++ b/index.bs @@ -11466,7 +11466,7 @@ The [=remote end steps=] with |command parameters| are: 1. If |extension directory entry| does not include file manifest.json return [=error=] with [=error code=] [=invalid web-extension=]. -1. Perform implementation defined steps to install |extension directory entry|. If this fails, return [=error=] with [=error code=] [=invalid web-extension=]. Otherwise let |extension id| be the unique identifier of the newly installed extension. +1. Perform implementation defined steps to install a web extension from the path specified by |extension directory entry|. If this fails, return [=error=] with [=error code=] [=invalid web-extension=]. Otherwise let |extension id| be the unique identifier of the newly installed web extension. 1. Let |allow private browsing| be a value of allowPrivateBrowsing field of |command parameters| if present, or false otherwise. From 25fa95cd4d0ac74d8207a28e813f1e3072f143dc Mon Sep 17 00:00:00 2001 From: Krzysztof Modras <1228153+chrmod@users.noreply.github.com> Date: Tue, 22 Oct 2024 21:01:33 +0200 Subject: [PATCH 17/41] Apply suggestions from code review Co-authored-by: Henrik Skupin --- index.bs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/index.bs b/index.bs index 2fb03078..d695f57f 100644 --- a/index.bs +++ b/index.bs @@ -648,7 +648,7 @@ with the following additional codes:
 ErrorCode = "invalid argument" /
-            "invalid web-extension" /
+            "invalid web extension" /
             "invalid selector" /
             "invalid session id" /
             "move target out of bounds" /
@@ -11375,21 +11375,21 @@ WebExtensionsResult = (
 
 ### Types ### {#module-webExtensions-types}
 
-#### The extensions.Extension Type #### {#type-webExtensions-Extension}
+#### The webExtensions.Extension Type #### {#type-webExtensions-Extension}
 
 
-To expand a extension data spec given |extension data spec|: +To expand an extension data spec given |extension data spec|: -1. Let |installation type| be a value of type field of |extension data spec|. +1. Let |type| be |extension data spec["type"]|. -1. If installing |installation type| isn't supported return [=error=] with [=error code=] [=unsupported operation=]. +1. If installing a web extension using |type| isn't supported return [=error=] with [=error code=] [=unsupported operation=]. 1. Switch on the value of the installation type:
"path"
- 1. Let |path| be a value of path field of |extension data spec|. + 1. Let |path| be |extension data spec|["path"]. 1. Let |entry| be a [=directory entry=] represeting the directory with that |path|.
"archive-path" @@ -11409,7 +11409,7 @@ To expand a extension data spec given |extension data spec|:
-### Commands ### {#module-extensions-commands} +### Commands ### {#module-webExtensions-commands} #### The webExtensions.install Command #### {#command-extensions-install} @@ -11435,7 +11435,7 @@ The webExtensions.install command installs an ext } webExtensions.ExtensionArchivePath = { - type: "archive-path", + type: "archivePath", path: text, } @@ -11458,19 +11458,19 @@ The webExtensions.install command installs an ext
The [=remote end steps=] with |command parameters| are: -1. If installing extensions isn't supported return [=error=] with error code [=unsupported operation=]. +1. If installing web extensions isn't supported return [=error=] with error code [=unsupported operation=]. 1. Let |extension data spec| be a value of extensionData field of the |command parameters|. 1. Let |extension directory entry| be the result of [=trying=] to [=expand a extension data spec=] with |extension data spec|. -1. If |extension directory entry| does not include file manifest.json return [=error=] with [=error code=] [=invalid web-extension=]. +1. If |extension directory entry| does not contain a file named manifest.json return [=error=] with [=error code=] [=invalid web-extension=]. 1. Perform implementation defined steps to install a web extension from the path specified by |extension directory entry|. If this fails, return [=error=] with [=error code=] [=invalid web-extension=]. Otherwise let |extension id| be the unique identifier of the newly installed web extension. 1. Let |allow private browsing| be a value of allowPrivateBrowsing field of |command parameters| if present, or false otherwise. -1. Perform any implementation-defined steps to enable extension to be run in private browsing based on the value of |allow private browsing|. +1. Perform any implementation-defined steps to enable the web extension to be run in private browsing mode based on the value of |allow private browsing|. 1. Let |result| be a [=/map=] matching the webExtensions.InstallResult production with the From 147928de4384a941f676841257ec52039bf3d41f Mon Sep 17 00:00:00 2001 From: Krzysztof Modras <1228153+chrmod@users.noreply.github.com> Date: Tue, 22 Oct 2024 21:06:57 +0200 Subject: [PATCH 18/41] Apply suggestions from code review Co-authored-by: Henrik Skupin --- index.bs | 1 - 1 file changed, 1 deletion(-) diff --git a/index.bs b/index.bs index d695f57f..3a3b0f79 100644 --- a/index.bs +++ b/index.bs @@ -11399,7 +11399,6 @@ To expand an extension data spec given |extension data spec|:
"base64"
- 1. Let |archive path| be a value of path field of |extension data spec|. 1. Let |bytes| be [=forgiving-base64 decode=] |extension data spec|["path"]. 1. Perform any implementation-defined steps to extract ZIP from |bytes| and let |entry| by a [=directory entry=] representing the extraction result, if this fails return [=error=] with [=error code=] [=invalid web-extension=]. From 20f13dddb2fa49656e863ca702198d9eb7c96450 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Tue, 22 Oct 2024 21:19:03 +0200 Subject: [PATCH 19/41] ExtensionData type --- index.bs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.bs b/index.bs index 3a3b0f79..27d4246a 100644 --- a/index.bs +++ b/index.bs @@ -11424,10 +11424,16 @@ The webExtensions.install command installs an ext ) webExtensions.InstallParameters = { - extensionData: webExtensions.ExtensionPath / webExtensions.ExtensionArchivePath / webExtensions.ExtensionBase64Encoded, + extensionData: webExtensions.ExtensionData, ? allowPrivateBrowsing: bool .default false, } + webExtensions.ExtensionData = ( + webExtensions.ExtensionPath / + webExtensions.ExtensionArchivePath / + webExtensions.ExtensionBase64Encoded + ) + webExtensions.ExtensionPath = { type: "path", path: text, From 7906a4cadcb9846f9886736e253769d145b43864 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Tue, 22 Oct 2024 21:28:32 +0200 Subject: [PATCH 20/41] replace switch with if set --- index.bs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/index.bs b/index.bs index 27d4246a..440077a8 100644 --- a/index.bs +++ b/index.bs @@ -2150,7 +2150,7 @@ To set the client window state given |window| and |state|: 1. If |current state| is equal to |state|, return [=success=] with data null. -1. Switch on the value of |state|: +1. In the following list of conditions and associated steps, run the first set of steps for which the associated condition is true:
"fullscreen" @@ -11384,23 +11384,23 @@ To expand an extension data spec given |extension data spec|: 1. If installing a web extension using |type| isn't supported return [=error=] with [=error code=] [=unsupported operation=]. -1. Switch on the value of the installation type: +1. In the following list of conditions and associated steps, run the first set of steps for which the associated condition is true:
-
"path" +
|type| is the string "path"
1. Let |path| be |extension data spec|["path"]. 1. Let |entry| be a [=directory entry=] represeting the directory with that |path|. -
"archive-path" +
|type| is the string "archivePath"
1. Let |archive path| be a value of path field of |extension data spec|. - 1. Perform any implementation-defined steps to extract ZIP from |archive path| and let |entry| by a [=directory entry=] representing the extraction result, if this fails return [=error=] with [=error code=] [=invalid web-extension=]. + 1. Perform any implementation-defined steps to extract ZIP from |archive path| and let |entry| by a [=directory entry=] representing the extraction result, if this fails return [=error=] with [=error code=] [=invalid web extension=]. -
"base64" +
|type| is the string "base64"
1. Let |bytes| be [=forgiving-base64 decode=] |extension data spec|["path"]. - 1. Perform any implementation-defined steps to extract ZIP from |bytes| and let |entry| by a [=directory entry=] representing the extraction result, if this fails return [=error=] with [=error code=] [=invalid web-extension=]. + 1. Perform any implementation-defined steps to extract the archive from |archive path| by using the ZIP algorithm, and let |entry| by a [=directory entry=] representing the extraction path, if this fails return [=error=] with [=error code=] [=invalid web extension=].
From 9c72317253621ee04f2abbf6fc4d8bbbf5d80479 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Tue, 22 Oct 2024 21:34:43 +0200 Subject: [PATCH 21/41] Extract extension type --- index.bs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.bs b/index.bs index 440077a8..691e43f0 100644 --- a/index.bs +++ b/index.bs @@ -11377,6 +11377,12 @@ WebExtensionsResult = ( #### The webExtensions.Extension Type #### {#type-webExtensions-Extension} +
+webExtensions.Extension = text
+
+ +The webExtensions.Extension type represents a web extension id within a browser. +
To expand an extension data spec given |extension data spec|: @@ -11454,7 +11460,7 @@ The webExtensions.install command installs an ext
       webExtensions.InstallResult = {
-        extension: text
+        extension: webExtensions.Extension
       }
       
From 1a8efb554a3eb40d4eb315e419e85ef47ea3a194 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Tue, 22 Oct 2024 21:39:59 +0200 Subject: [PATCH 22/41] Fix naming --- index.bs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.bs b/index.bs index 691e43f0..2ca5d50e 100644 --- a/index.bs +++ b/index.bs @@ -11384,7 +11384,7 @@ webExtensions.Extension = text The webExtensions.Extension type represents a web extension id within a browser.
-To expand an extension data spec given |extension data spec|: +To expand a web extension data spec given |extension data spec|: 1. Let |type| be |extension data spec["type"]|. @@ -11473,11 +11473,11 @@ The [=remote end steps=] with |command parameters| are: 1. Let |extension data spec| be a value of extensionData field of the |command parameters|. -1. Let |extension directory entry| be the result of [=trying=] to [=expand a extension data spec=] with |extension data spec|. +1. Let |extension directory entry| be the result of [=trying=] to [=expand a web extension data spec=] with |extension data spec|. -1. If |extension directory entry| does not contain a file named manifest.json return [=error=] with [=error code=] [=invalid web-extension=]. +1. If |extension directory entry| does not contain a file named manifest.json return [=error=] with [=error code=] [=invalid web extension=]. -1. Perform implementation defined steps to install a web extension from the path specified by |extension directory entry|. If this fails, return [=error=] with [=error code=] [=invalid web-extension=]. Otherwise let |extension id| be the unique identifier of the newly installed web extension. +1. Perform implementation defined steps to install a web extension from the path specified by |extension directory entry|. If this fails, return [=error=] with [=error code=] [=invalid web extension=]. Otherwise let |extension id| be the unique identifier of the newly installed web extension. 1. Let |allow private browsing| be a value of allowPrivateBrowsing field of |command parameters| if present, or false otherwise. From f3044c86f618e85b45e98f5aa5413940bc9e8b6a Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Tue, 22 Oct 2024 22:12:08 +0200 Subject: [PATCH 23/41] Define webExtensions.uninstall --- index.bs | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index 2ca5d50e..99c48aff 100644 --- a/index.bs +++ b/index.bs @@ -11361,7 +11361,8 @@ managing and interacting with web-extensions.
 WebExtensionsCommand = (
-  webExtensions.Install
+  webExtensions.Install,
+  webExtensions.Uninstall
 )
 
@@ -11418,7 +11419,7 @@ To expand a web extension data spec given |extension data spec|: #### The webExtensions.install Command #### {#command-extensions-install} -The webExtensions.install command installs an extension for the session. +The webExtensions.install command installs a web extension for the session.
Command Type
@@ -11491,6 +11492,39 @@ The [=remote end steps=] with |command parameters| are:
+#### The webExtensions.uninstall Command #### {#command-extensions-uninstall} + +The webExtensions.uninstall command uninstalls a web extension for the session. + +
+
Command Type
+
+
+      webExtensions.Uninstall = (
+         method: "webExtensions.uninstall",
+         params: webExtensions.InstallParameters
+      )
+
+      webExtensions.UninstallParameters = {
+         extension: webExtensions.Extension,
+      }
+      
+
+
+ +
+The [=remote end steps=] with |command parameters| are: + +1. Let |extension| be a value of extension field of the |command parameters|. + +1. If the browser has no web extensionwith an id equal to |extension|, return [=error=] with [=error code=] [=invalid argument=]. + +1. Perform any implementation-defined steps to remove the web extension from the browser. If this fails, return [=error=] with [=error code=] [=unknown error=]. + +1. Return [=success=] with data null. + +
+ # Patches to Other Specifications # {#patches} This specification requires some changes to external specifications to provide the necessary From b54f1a8547b16db0988c511054ec13eef9b7709e Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Tue, 22 Oct 2024 22:13:26 +0200 Subject: [PATCH 24/41] fix --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index 99c48aff..11c46efd 100644 --- a/index.bs +++ b/index.bs @@ -11407,7 +11407,7 @@ To expand a web extension data spec given |extension data spec|:
|type| is the string "base64"
1. Let |bytes| be [=forgiving-base64 decode=] |extension data spec|["path"]. - 1. Perform any implementation-defined steps to extract the archive from |archive path| by using the ZIP algorithm, and let |entry| by a [=directory entry=] representing the extraction path, if this fails return [=error=] with [=error code=] [=invalid web extension=]. + 1. Perform any implementation-defined steps to extract the archive from |bytes| by using the ZIP algorithm, and let |entry| by a [=directory entry=] representing the extraction path, if this fails return [=error=] with [=error code=] [=invalid web extension=].
From 72c5dfe8d12eac004e26d9380e3702d22f192769 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Tue, 22 Oct 2024 22:17:27 +0200 Subject: [PATCH 25/41] Move expand a web extension data spec to a better place --- index.bs | 62 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/index.bs b/index.bs index 11c46efd..92a9815c 100644 --- a/index.bs +++ b/index.bs @@ -11384,37 +11384,6 @@ webExtensions.Extension = text The webExtensions.Extension type represents a web extension id within a browser. -
-To expand a web extension data spec given |extension data spec|: - -1. Let |type| be |extension data spec["type"]|. - -1. If installing a web extension using |type| isn't supported return [=error=] with [=error code=] [=unsupported operation=]. - -1. In the following list of conditions and associated steps, run the first set of steps for which the associated condition is true: - -
-
|type| is the string "path" -
- 1. Let |path| be |extension data spec|["path"]. - 1. Let |entry| be a [=directory entry=] represeting the directory with that |path|. - -
|type| is the string "archivePath" -
- 1. Let |archive path| be a value of path field of |extension data spec|. - 1. Perform any implementation-defined steps to extract ZIP from |archive path| and let |entry| by a [=directory entry=] representing the extraction result, if this fails return [=error=] with [=error code=] [=invalid web extension=]. - -
|type| is the string "base64" -
- 1. Let |bytes| be [=forgiving-base64 decode=] |extension data spec|["path"]. - 1. Perform any implementation-defined steps to extract the archive from |bytes| by using the ZIP algorithm, and let |entry| by a [=directory entry=] representing the extraction path, if this fails return [=error=] with [=error code=] [=invalid web extension=]. - -
- -1. Return [=success=] with data |entry|. - -
- ### Commands ### {#module-webExtensions-commands} #### The webExtensions.install Command #### {#command-extensions-install} @@ -11492,6 +11461,37 @@ The [=remote end steps=] with |command parameters| are:
+
+To expand a web extension data spec given |extension data spec|: + +1. Let |type| be |extension data spec["type"]|. + +1. If installing a web extension using |type| isn't supported return [=error=] with [=error code=] [=unsupported operation=]. + +1. In the following list of conditions and associated steps, run the first set of steps for which the associated condition is true: + +
+
|type| is the string "path" +
+ 1. Let |path| be |extension data spec|["path"]. + 1. Let |entry| be a [=directory entry=] represeting the directory with that |path|. + +
|type| is the string "archivePath" +
+ 1. Let |archive path| be a value of path field of |extension data spec|. + 1. Perform any implementation-defined steps to extract ZIP from |archive path| and let |entry| by a [=directory entry=] representing the extraction result, if this fails return [=error=] with [=error code=] [=invalid web extension=]. + +
|type| is the string "base64" +
+ 1. Let |bytes| be [=forgiving-base64 decode=] |extension data spec|["path"]. + 1. Perform any implementation-defined steps to extract the archive from |bytes| by using the ZIP algorithm, and let |entry| by a [=directory entry=] representing the extraction path, if this fails return [=error=] with [=error code=] [=invalid web extension=]. + +
+ +1. Return [=success=] with data |entry|. + +
+ #### The webExtensions.uninstall Command #### {#command-extensions-uninstall} The webExtensions.uninstall command uninstalls a web extension for the session. From 364257b034384e18ffae897ce150331b2d5cb145 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Tue, 22 Oct 2024 22:19:20 +0200 Subject: [PATCH 26/41] fix typo --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index 92a9815c..8f5f3856 100644 --- a/index.bs +++ b/index.bs @@ -11474,7 +11474,7 @@ To expand a web extension data spec given |extension data spec|:
|type| is the string "path"
1. Let |path| be |extension data spec|["path"]. - 1. Let |entry| be a [=directory entry=] represeting the directory with that |path|. + 1. Let |entry| be a [=directory entry=] representing the directory with that |path|.
|type| is the string "archivePath"
From 8298905c0fc189ff0c56bad840ebb5695a0b1d4e Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Wed, 23 Oct 2024 09:04:57 +0200 Subject: [PATCH 27/41] Fix name --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index 8f5f3856..094d5afb 100644 --- a/index.bs +++ b/index.bs @@ -11353,7 +11353,7 @@ The [=remote end steps=] given |session| and |command parameters| are: ## The webExtension Module ## {#module-webExtension} The webExtensions module contains functionality for -managing and interacting with web-extensions. +managing and interacting with web extensions. ### Definition ### {#module-webExtensions-definition} From d5d20a166e3b9b966cb4663a82fbdcea2da7fd63 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras <1228153+chrmod@users.noreply.github.com> Date: Fri, 25 Oct 2024 10:12:37 +0200 Subject: [PATCH 28/41] Update index.bs Co-authored-by: Alex Rudenko --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index 094d5afb..b05fb54e 100644 --- a/index.bs +++ b/index.bs @@ -11517,7 +11517,7 @@ The [=remote end steps=] with |command parameters| are: 1. Let |extension| be a value of extension field of the |command parameters|. -1. If the browser has no web extensionwith an id equal to |extension|, return [=error=] with [=error code=] [=invalid argument=]. +1. If the browser has no web extension with an id equal to |extension|, return [=error=] with [=error code=] [=invalid argument=]. 1. Perform any implementation-defined steps to remove the web extension from the browser. If this fails, return [=error=] with [=error code=] [=unknown error=]. From 78bfd47e3b112eebe92774e725b52ba47e17b51e Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Fri, 25 Oct 2024 10:24:31 +0200 Subject: [PATCH 29/41] Remove allowPrivateBrowsing --- index.bs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/index.bs b/index.bs index b05fb54e..5ffd384e 100644 --- a/index.bs +++ b/index.bs @@ -11401,7 +11401,6 @@ The webExtensions.install command installs a web webExtensions.InstallParameters = { extensionData: webExtensions.ExtensionData, - ? allowPrivateBrowsing: bool .default false, } webExtensions.ExtensionData = ( @@ -11449,10 +11448,6 @@ The [=remote end steps=] with |command parameters| are: 1. Perform implementation defined steps to install a web extension from the path specified by |extension directory entry|. If this fails, return [=error=] with [=error code=] [=invalid web extension=]. Otherwise let |extension id| be the unique identifier of the newly installed web extension. -1. Let |allow private browsing| be a value of allowPrivateBrowsing field of |command parameters| if present, or false otherwise. - -1. Perform any implementation-defined steps to enable the web extension to be run in private browsing mode based on the value of |allow private browsing|. - 1. Let |result| be a [=/map=] matching the webExtensions.InstallResult production with the extension field set to |extension id|. From fc8c6d1b1bb7912e1366453f20ca066f0ae49d07 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Fri, 25 Oct 2024 10:26:19 +0200 Subject: [PATCH 30/41] Remove manifest validation --- index.bs | 2 -- 1 file changed, 2 deletions(-) diff --git a/index.bs b/index.bs index 5ffd384e..a4f093d7 100644 --- a/index.bs +++ b/index.bs @@ -11444,8 +11444,6 @@ The [=remote end steps=] with |command parameters| are: 1. Let |extension directory entry| be the result of [=trying=] to [=expand a web extension data spec=] with |extension data spec|. -1. If |extension directory entry| does not contain a file named manifest.json return [=error=] with [=error code=] [=invalid web extension=]. - 1. Perform implementation defined steps to install a web extension from the path specified by |extension directory entry|. If this fails, return [=error=] with [=error code=] [=invalid web extension=]. Otherwise let |extension id| be the unique identifier of the newly installed web extension. 1. Let |result| be a [=/map=] matching the From 1b0ce839eb2f83eb441fc408679f498e1a3893d8 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras <1228153+chrmod@users.noreply.github.com> Date: Wed, 30 Oct 2024 14:11:36 +0100 Subject: [PATCH 31/41] Update index.bs Co-authored-by: kiaraarose <109696420+kiaraarose@users.noreply.github.com> --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index a4f093d7..58a12fd6 100644 --- a/index.bs +++ b/index.bs @@ -604,7 +604,7 @@ with the following additional codes:
invalid web extension -
Tried to install invalid a web extension. +
Tried to install an invalid web extension.
no such client window
Tried to interact with an unknown [=client window=]. From 2813d21925d73d66fffa9bce2434e8ef38294dd2 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras <1228153+chrmod@users.noreply.github.com> Date: Wed, 30 Oct 2024 14:12:26 +0100 Subject: [PATCH 32/41] Update index.bs Co-authored-by: Alex Rudenko --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index 58a12fd6..bb763ef0 100644 --- a/index.bs +++ b/index.bs @@ -11457,7 +11457,7 @@ The [=remote end steps=] with |command parameters| are:
To expand a web extension data spec given |extension data spec|: -1. Let |type| be |extension data spec["type"]|. +1. Let |type| be |extension data spec|["type"]. 1. If installing a web extension using |type| isn't supported return [=error=] with [=error code=] [=unsupported operation=]. From a83badb6d48af4bd7a11aadbdb85f781b4bdbf49 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras <1228153+chrmod@users.noreply.github.com> Date: Wed, 30 Oct 2024 14:13:28 +0100 Subject: [PATCH 33/41] Update index.bs --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index bb763ef0..11483aa2 100644 --- a/index.bs +++ b/index.bs @@ -11472,7 +11472,7 @@ To expand a web extension data spec given |extension data spec|:
|type| is the string "archivePath"
1. Let |archive path| be a value of path field of |extension data spec|. - 1. Perform any implementation-defined steps to extract ZIP from |archive path| and let |entry| by a [=directory entry=] representing the extraction result, if this fails return [=error=] with [=error code=] [=invalid web extension=]. + 1. Perform any implementation-defined steps to extract ZIP from |archive path| and let |entry| be a [=directory entry=] representing the extraction result, if this fails return [=error=] with [=error code=] [=invalid web extension=].
|type| is the string "base64"
From 19168830fa790124a0504ab5d748a6db3d039eb9 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras <1228153+chrmod@users.noreply.github.com> Date: Tue, 12 Nov 2024 20:14:39 +0100 Subject: [PATCH 34/41] Apply suggestions from code review Co-authored-by: Henrik Skupin --- index.bs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/index.bs b/index.bs index 11483aa2..4524dc14 100644 --- a/index.bs +++ b/index.bs @@ -648,9 +648,9 @@ with the following additional codes:
 ErrorCode = "invalid argument" /
-            "invalid web extension" /
             "invalid selector" /
             "invalid session id" /
+            "invalid web extension" /
             "move target out of bounds" /
             "no such alert" /
             "no such element" /
@@ -11404,9 +11404,9 @@ The webExtensions.install command installs a web
       }
 
       webExtensions.ExtensionData = (
-         webExtensions.ExtensionPath /
          webExtensions.ExtensionArchivePath /
-         webExtensions.ExtensionBase64Encoded
+         webExtensions.ExtensionBase64Encoded /
+         webExtensions.ExtensionPath
       )
 
       webExtensions.ExtensionPath = {
@@ -11440,7 +11440,7 @@ The [=remote end steps=] with |command parameters| are:
 
 1. If installing web extensions isn't supported return [=error=] with error code [=unsupported operation=].
 
-1. Let |extension data spec| be a value of extensionData field of the |command parameters|.
+1. Let |extension data spec| be |command parameters|["extensionData"].
 
 1. Let |extension directory entry| be the result of [=trying=] to [=expand a web extension data spec=] with |extension data spec|.
 
@@ -11471,7 +11471,7 @@ To expand a web extension data spec given |extension data spec|:
 
     
|type| is the string "archivePath"
- 1. Let |archive path| be a value of path field of |extension data spec|. + 1. Let |archive path| be |extension data spec|["path"]. 1. Perform any implementation-defined steps to extract ZIP from |archive path| and let |entry| be a [=directory entry=] representing the extraction result, if this fails return [=error=] with [=error code=] [=invalid web extension=].
|type| is the string "base64" @@ -11481,7 +11481,7 @@ To expand a web extension data spec given |extension data spec|:
-1. Return [=success=] with data |entry|. +1. Return |entry|. @@ -11508,7 +11508,7 @@ The webExtensions.uninstall command uninstalls a
The [=remote end steps=] with |command parameters| are: -1. Let |extension| be a value of extension field of the |command parameters|. +1. Let |extension| be |command parameters|["extension"]. 1. If the browser has no web extension with an id equal to |extension|, return [=error=] with [=error code=] [=invalid argument=]. From afc907223553f1e85f7872d38ee7e4a04d5ee965 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Tue, 12 Nov 2024 20:23:53 +0100 Subject: [PATCH 35/41] Make module name sigular --- index.bs | 72 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/index.bs b/index.bs index 4524dc14..ec00f714 100644 --- a/index.bs +++ b/index.bs @@ -11352,17 +11352,17 @@ The [=remote end steps=] given |session| and |command parameters| are: ## The webExtension Module ## {#module-webExtension} -The webExtensions module contains functionality for +The webExtension module contains functionality for managing and interacting with web extensions. -### Definition ### {#module-webExtensions-definition} +### Definition ### {#module-webExtension-definition} [=remote end definition=]
 WebExtensionsCommand = (
-  webExtensions.Install,
-  webExtensions.Uninstall
+  webExtension.Install,
+  webExtension.Uninstall
 )
 
@@ -11370,56 +11370,56 @@ WebExtensionsCommand = (
 WebExtensionsResult = (
-  webExtensions.InstallResult
+  webExtension.InstallResult
 )
 
-### Types ### {#module-webExtensions-types} +### Types ### {#module-webExtension-types} -#### The webExtensions.Extension Type #### {#type-webExtensions-Extension} +#### The webExtension.Extension Type #### {#type-webExtension-Extension}
-webExtensions.Extension = text
+webExtension.Extension = text
 
-The webExtensions.Extension type represents a web extension id within a browser. +The webExtension.Extension type represents a web extension id within a browser. -### Commands ### {#module-webExtensions-commands} +### Commands ### {#module-webExtension-commands} -#### The webExtensions.install Command #### {#command-extensions-install} +#### The webExtension.install Command #### {#command-webExtension-install} -The webExtensions.install command installs a web extension for the session. +The webExtension.install command installs a web extension for the session.
Command Type
-      webExtensions.Install = (
-         method: "webExtensions.install",
-         params: webExtensions.InstallParameters
+      webExtension.Install = (
+         method: "webExtension.install",
+         params: webExtension.InstallParameters
       )
 
-      webExtensions.InstallParameters = {
-         extensionData: webExtensions.ExtensionData,
+      webExtension.InstallParameters = {
+         extensionData: webExtension.ExtensionData,
       }
 
-      webExtensions.ExtensionData = (
-         webExtensions.ExtensionArchivePath /
-         webExtensions.ExtensionBase64Encoded /
-         webExtensions.ExtensionPath
+      webExtension.ExtensionData = (
+         webExtension.ExtensionArchivePath /
+         webExtension.ExtensionBase64Encoded /
+         webExtension.ExtensionPath
       )
 
-      webExtensions.ExtensionPath = {
+      webExtension.ExtensionPath = {
          type: "path",
          path: text,
       }
 
-      webExtensions.ExtensionArchivePath = {
+      webExtension.ExtensionArchivePath = {
          type: "archivePath",
          path: text,
       }
 
-      webExtensions.ExtensionBase64Encoded = {
+      webExtension.ExtensionBase64Encoded = {
          type: "base64",
          value: text,
       }
@@ -11428,14 +11428,14 @@ The webExtensions.install command installs a web
    
Result Type
-      webExtensions.InstallResult = {
-        extension: webExtensions.Extension
+      webExtension.InstallResult = {
+        extension: webExtension.Extension
       }
       
-
+
The [=remote end steps=] with |command parameters| are: 1. If installing web extensions isn't supported return [=error=] with error code [=unsupported operation=]. @@ -11447,7 +11447,7 @@ The [=remote end steps=] with |command parameters| are: 1. Perform implementation defined steps to install a web extension from the path specified by |extension directory entry|. If this fails, return [=error=] with [=error code=] [=invalid web extension=]. Otherwise let |extension id| be the unique identifier of the newly installed web extension. 1. Let |result| be a [=/map=] matching the - webExtensions.InstallResult production with the + webExtension.InstallResult production with the extension field set to |extension id|. 1. Return [=success=] with data |result|. @@ -11485,27 +11485,27 @@ To expand a web extension data spec given |extension data spec|:
-#### The webExtensions.uninstall Command #### {#command-extensions-uninstall} +#### The webExtension.uninstall Command #### {#command-webExtension-uninstall} -The webExtensions.uninstall command uninstalls a web extension for the session. +The webExtension.uninstall command uninstalls a web extension for the session.
Command Type
-      webExtensions.Uninstall = (
-         method: "webExtensions.uninstall",
-         params: webExtensions.InstallParameters
+      webExtension.Uninstall = (
+         method: "webExtension.uninstall",
+         params: webExtension.InstallParameters
       )
 
-      webExtensions.UninstallParameters = {
-         extension: webExtensions.Extension,
+      webExtension.UninstallParameters = {
+         extension: webExtension.Extension,
       }
       
-
+
The [=remote end steps=] with |command parameters| are: 1. Let |extension| be |command parameters|["extension"]. From bca7d145816e08739dc103969b55b9061f883a22 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Tue, 12 Nov 2024 20:30:32 +0100 Subject: [PATCH 36/41] new error code for not install extension --- index.bs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.bs b/index.bs index ec00f714..552b9efb 100644 --- a/index.bs +++ b/index.bs @@ -633,6 +633,9 @@ with the following additional codes:
no such user context
Tried to reference an unknown [=user context=]. +
no such web extension +
Tried to interact with not installed web extension. +
unable to close browser
Tried to close the browser, but failed to do so. @@ -663,6 +666,7 @@ ErrorCode = "invalid argument" / "no such script" / "no such storage partition" / "no such user context" / + "no such web extension" / "session not created" / "unable to capture screen" / "unable to close browser" / @@ -11510,7 +11514,7 @@ The [=remote end steps=] with |command parameters| are: 1. Let |extension| be |command parameters|["extension"]. -1. If the browser has no web extension with an id equal to |extension|, return [=error=] with [=error code=] [=invalid argument=]. +1. If the browser has no web extension with an id equal to |extension|, return [=error=] with [=error code=] [=no such web extension=]. 1. Perform any implementation-defined steps to remove the web extension from the browser. If this fails, return [=error=] with [=error code=] [=unknown error=]. From e9099c254849ee1a17852b8638e71f93c8ac96a0 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Tue, 12 Nov 2024 20:37:24 +0100 Subject: [PATCH 37/41] Reorder algorithms --- index.bs | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/index.bs b/index.bs index 552b9efb..1723d2cc 100644 --- a/index.bs +++ b/index.bs @@ -11439,25 +11439,6 @@ The webExtension.install command installs a web e
-
-The [=remote end steps=] with |command parameters| are: - -1. If installing web extensions isn't supported return [=error=] with error code [=unsupported operation=]. - -1. Let |extension data spec| be |command parameters|["extensionData"]. - -1. Let |extension directory entry| be the result of [=trying=] to [=expand a web extension data spec=] with |extension data spec|. - -1. Perform implementation defined steps to install a web extension from the path specified by |extension directory entry|. If this fails, return [=error=] with [=error code=] [=invalid web extension=]. Otherwise let |extension id| be the unique identifier of the newly installed web extension. - -1. Let |result| be a [=/map=] matching the - webExtension.InstallResult production with the - extension field set to |extension id|. - -1. Return [=success=] with data |result|. - -
-
To expand a web extension data spec given |extension data spec|: @@ -11489,6 +11470,26 @@ To expand a web extension data spec given |extension data spec|:
+
+The [=remote end steps=] with |command parameters| are: + +1. If installing web extensions isn't supported return [=error=] with error code [=unsupported operation=]. + +1. Let |extension data spec| be |command parameters|["extensionData"]. + +1. Let |extension directory entry| be the result of [=trying=] to [=expand a web extension data spec=] with |extension data spec|. + +1. Perform implementation defined steps to install a web extension from the path specified by |extension directory entry|. If this fails, return [=error=] with [=error code=] [=invalid web extension=]. Otherwise let |extension id| be the unique identifier of the newly installed web extension. + +1. Let |result| be a [=/map=] matching the + webExtension.InstallResult production with the + extension field set to |extension id|. + +1. Return [=success=] with data |result|. + +
+ + #### The webExtension.uninstall Command #### {#command-webExtension-uninstall} The webExtension.uninstall command uninstalls a web extension for the session. From e58302800fb6f67d8320cb3d4fed1f5f2a3cfa5f Mon Sep 17 00:00:00 2001 From: Krzysztof Modras <1228153+chrmod@users.noreply.github.com> Date: Wed, 13 Nov 2024 20:51:58 +0100 Subject: [PATCH 38/41] Update index.bs Co-authored-by: Henrik Skupin --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index 1723d2cc..b955d975 100644 --- a/index.bs +++ b/index.bs @@ -11500,7 +11500,7 @@ The webExtension.uninstall command uninstalls a w
       webExtension.Uninstall = (
          method: "webExtension.uninstall",
-         params: webExtension.InstallParameters
+         params: webExtension.UninstallParameters
       )
 
       webExtension.UninstallParameters = {

From 42570bc0d8b816644fa573500ad26ed48f41f9ad Mon Sep 17 00:00:00 2001
From: Krzysztof Modras 
Date: Wed, 13 Nov 2024 20:56:37 +0100
Subject: [PATCH 39/41] Use browser instead of the session

---
 index.bs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/index.bs b/index.bs
index b955d975..1a04be7d 100644
--- a/index.bs
+++ b/index.bs
@@ -11392,7 +11392,7 @@ The webExtension.Extension type represents a web extension id withi
 
 #### The webExtension.install Command #### {#command-webExtension-install}
 
-The webExtension.install command installs a web extension for the session.
+The webExtension.install command installs a web extension for the browser.
 
 
Command Type
@@ -11492,7 +11492,7 @@ The [=remote end steps=] with |command parameters| are: #### The webExtension.uninstall Command #### {#command-webExtension-uninstall} -The webExtension.uninstall command uninstalls a web extension for the session. +The webExtension.uninstall command uninstalls a web extension for the browser.
Command Type
From e683f606a9317a8adb5477bf802fa13e263cc526 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras <1228153+chrmod@users.noreply.github.com> Date: Fri, 15 Nov 2024 22:32:55 +0100 Subject: [PATCH 40/41] Apply suggestions from code review Co-authored-by: jgraham --- index.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index 1a04be7d..9f5c0c9c 100644 --- a/index.bs +++ b/index.bs @@ -11457,7 +11457,7 @@ To expand a web extension data spec given |extension data spec|:
|type| is the string "archivePath"
1. Let |archive path| be |extension data spec|["path"]. - 1. Perform any implementation-defined steps to extract ZIP from |archive path| and let |entry| be a [=directory entry=] representing the extraction result, if this fails return [=error=] with [=error code=] [=invalid web extension=]. + 1. Perform implementation-defined steps to extract ZIP from |archive path|. If this fails return [=error=] with [=error code=] [=invalid web extension=]. Otherwise let |entry| be a [=directory entry=] representing the extraction result.
|type| is the string "base64"
@@ -11479,7 +11479,7 @@ The [=remote end steps=] with |command parameters| are: 1. Let |extension directory entry| be the result of [=trying=] to [=expand a web extension data spec=] with |extension data spec|. -1. Perform implementation defined steps to install a web extension from the path specified by |extension directory entry|. If this fails, return [=error=] with [=error code=] [=invalid web extension=]. Otherwise let |extension id| be the unique identifier of the newly installed web extension. +1. Perform implementation defined steps to install a web extension from |extension directory entry|. If this fails, return [=error=] with [=error code=] [=invalid web extension=]. Otherwise let |extension id| be the unique identifier of the newly installed web extension. 1. Let |result| be a [=/map=] matching the webExtension.InstallResult production with the From edfa91f7597714fa3df28d3c4a045bf10e3882f1 Mon Sep 17 00:00:00 2001 From: Krzysztof Modras Date: Fri, 15 Nov 2024 22:59:28 +0100 Subject: [PATCH 41/41] Define extact from zip --- index.bs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index 9f5c0c9c..f1350280 100644 --- a/index.bs +++ b/index.bs @@ -11439,6 +11439,17 @@ The webExtension.install command installs a web e
+
+To extract a zip archive given |bytes|: + +1. Perform implementation defined steps to decode |bytes| using the zip compression algorithm. TODO: Find a better reference for zip decoding. + +1. If the previous step failed (e.g. because |bytes| did not represent valid zip-compressed data) then return [=error=] with error code [=invalid web extension=]. Otherwise let |entry| be a [=directory entry=] containing the extracted filesystem entries. + +1. Return |entry|. + +
+
To expand a web extension data spec given |extension data spec|: @@ -11457,12 +11468,13 @@ To expand a web extension data spec given |extension data spec|:
|type| is the string "archivePath"
1. Let |archive path| be |extension data spec|["path"]. - 1. Perform implementation-defined steps to extract ZIP from |archive path|. If this fails return [=error=] with [=error code=] [=invalid web extension=]. Otherwise let |entry| be a [=directory entry=] representing the extraction result. + 1. Perform implementation defined steps to read |bytes| from a file located at |archive path|. + 1. Let |entry| be the result of [=trying=] to [=extract a zip archive=] given |bytes|.
|type| is the string "base64"
1. Let |bytes| be [=forgiving-base64 decode=] |extension data spec|["path"]. - 1. Perform any implementation-defined steps to extract the archive from |bytes| by using the ZIP algorithm, and let |entry| by a [=directory entry=] representing the extraction path, if this fails return [=error=] with [=error code=] [=invalid web extension=]. + 1. Let |entry| be the result of [=trying=] to [=extract a zip archive=] given |bytes|.