You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The <code>extensions.Extension</code> type represents an extension with its additional properties.
11365
+
11366
+
<div algorithm>
11367
+
To <dfn>expand a install path spec</dfn> given |install path spec|:
11368
+
11369
+
1. Let |path| be a value of <code>path</code> field of |install path spec| if the value of <code>type</code> of the |install path spec| is equal to <code>path</code>,
11370
+
otherwise perform any implementation-defined steps to create a temporary folder and make its path to be the value of |path|.
11371
+
11372
+
1. Let |archive path| be a value of <code>path</code> field of |install path spec| if the value of <code>type</code> of the |install path spec| is equal to <code>archive-path</code>,
11373
+
otherwise if the value of <code>type</code> of the |install path spec| is equal to <code>archive-path</code> perform any implementation-defined steps to create a temporary file
11374
+
being a result of Base64 decodeing of the value of <code>value</code> filed of |install path spec| and make its path to be the value of |archive path|,
11375
+
otherwise |archive path| is null.
11376
+
11377
+
1. If |archive path| if not null:
11378
+
11379
+
1. Perform any implementation-defined steps to unpack archive into |path|.
11380
+
11381
+
1. Let |extension files| be a result of implementation-defined steps to list all paths in |path| folder.
11382
+
11383
+
1. Let |extension archive| be a map matching the <code>extensions.ExtensionArchive</code> production, with the <code>files</code> field set to |extension files|.
11384
+
11385
+
1. Return [=success=] with data |extension archive|.
11386
+
11387
+
</div>
11388
+
11389
+
### Commands ### {#module-extensions-commands}
11390
+
11391
+
#### The extensions.install Command #### {#command-extensions-install}
11392
+
11393
+
The <dfn export for=commands>extensions.install</dfn> command installs an extension for the session.
11394
+
11395
+
<dl>
11396
+
<dt>Command Type</dt>
11397
+
<dd>
11398
+
<pre class="cddl remote-cddl">
11399
+
extensions.Install = (
11400
+
method: "extensions.install",
11401
+
params: extensions.InstallParameters
11402
+
)
11403
+
11404
+
extensions.InstallParameters = {
11405
+
extension: extensions.Extension,
11406
+
}
11407
+
</pre>
11408
+
</dd>
11409
+
<dt>Result Type</dt>
11410
+
<dd>
11411
+
<pre class="cddl local-cddl">
11412
+
extensions.InstallResult = (
11413
+
extensionId: text
11414
+
)
11415
+
</pre>
11416
+
</dd>
11417
+
</dl>
11418
+
11419
+
<div algorithm="remote end steps for extensions.install">
11420
+
The [=remote end steps=] with |session| and |command parameters| are:
11421
+
11422
+
1. Let the |extension| be the value of the <code>extension</code> field of |command parameters|
11423
+
11424
+
1. If installing |extension| isn't supported return [=error=] with error code [=unsupported operation=].
11425
+
11426
+
1. Let |install path spec| be a value of <code>installPath</code> field of the |extension|.
11427
+
11428
+
1. Let |extension archive| be the result of [=trying=] to [=expand a install path spec=] with |install path spec|.
11429
+
11430
+
1. Let |extension files| be a value of <code>files<code> field of |extension archive|.
11431
+
11432
+
1. If |extension files| does not include entry <code>manifest.json</code> return [=error=] with code [=invalid extension=]
11433
+
11434
+
1. Perform any implementation-defined steps to install the extension into |session|.
11435
+
11436
+
1. Let |extension id| be a unique identifier of the |extension| for the browser decided by the implementation-defined steps.
11437
+
11438
+
1. Let |allow private browsing| be a value of <code>allowPrivateBrowsing</code> field of |command parameters| if present, or false otherwise.
11439
+
11440
+
1. Perform any implementation-defined steps to enable extension to be run in private browsing based on the valu of |allow private browsing|.
11441
+
11442
+
1. Let |result| be a [=/map=] matching the
11443
+
<code>extensions.InstallResult</code> production with the
11444
+
<code>extensionId</code> field set to |extension id|.
11445
+
11446
+
1. Return [=success=] with data |result|.
11447
+
11448
+
</div>
11449
+
11393
11450
# Patches to Other Specifications # {#patches}
11394
11451
11395
11452
This specification requires some changes to external specifications to provide the necessary
0 commit comments