Skip to content

Commit

Permalink
feat: support chrome.scripting extension APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Aug 7, 2023
1 parent 67523a4 commit 385065d
Show file tree
Hide file tree
Showing 16 changed files with 2,087 additions and 14 deletions.
53 changes: 40 additions & 13 deletions docs/api/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,20 @@ provisional and may be removed.

All features of this API are supported.

See [official documentation](https://developer.chrome.com/docs/extensions/reference/devtools_inspectedWindow) for more information.

### `chrome.devtools.network`

All features of this API are supported.

See [official documentation](https://developer.chrome.com/docs/extensions/reference/devtools_network) for more information.

### `chrome.devtools.panels`

All features of this API are supported.

See [official documentation](https://developer.chrome.com/docs/extensions/reference/devtools_panels) for more information.

### `chrome.extension`

The following properties of `chrome.extension` are supported:
Expand All @@ -63,6 +69,22 @@ The following methods of `chrome.extension` are supported:
- `chrome.extension.getURL`
- `chrome.extension.getBackgroundPage`

See [official documentation](https://developer.chrome.com/docs/extensions/reference/extension) for more information.

### `chrome.management`

The following methods of `chrome.management` are supported:

- `chrome.management.getAll`
- `chrome.management.get`
- `chrome.management.getSelf`
- `chrome.management.getPermissionWarningsById`
- `chrome.management.getPermissionWarningsByManifest`
- `chrome.management.onEnabled`
- `chrome.management.onDisabled`

See [official documentation](https://developer.chrome.com/docs/extensions/reference/management) for more information.

### `chrome.runtime`

The following properties of `chrome.runtime` are supported:
Expand All @@ -89,10 +111,23 @@ The following events of `chrome.runtime` are supported:
- `chrome.runtime.onConnect`
- `chrome.runtime.onMessage`

See [official documentation](https://developer.chrome.com/docs/extensions/reference/runtime) for more information.

### `chrome.scripting`

All features of this API are supported.

See [official documentation](https://developer.chrome.com/docs/extensions/reference/scripting) for more information.

### `chrome.storage`

Only `chrome.storage.local` is supported; `chrome.storage.sync` and
`chrome.storage.managed` are not.
The following methods of `chrome.tabs` are supported:

- `chrome.storage.local`

`chrome.storage.sync` and `chrome.storage.managed` are **not** supported.

See [official documentation](https://developer.chrome.com/docs/extensions/reference/storage) for more information.

### `chrome.tabs`

Expand All @@ -108,20 +143,12 @@ The following methods of `chrome.tabs` are supported:
> tab". Since Electron has no such concept, passing `-1` as a tab ID is not
> supported and will raise an error.
### `chrome.management`

The following methods of `chrome.management` are supported:

- `chrome.management.getAll`
- `chrome.management.get`
- `chrome.management.getSelf`
- `chrome.management.getPermissionWarningsById`
- `chrome.management.getPermissionWarningsByManifest`
- `chrome.management.onEnabled`
- `chrome.management.onDisabled`
See [official documentation](https://developer.chrome.com/docs/extensions/reference/tabs) for more information.

### `chrome.webRequest`

All features of this API are supported.

> **NOTE:** Electron's [`webRequest`](web-request.md) module takes precedence over `chrome.webRequest` if there are conflicting handlers.
See [official documentation](https://developer.chrome.com/docs/extensions/reference/webRequest) for more information.
2 changes: 2 additions & 0 deletions filenames.gni
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,8 @@ filenames = {
"shell/browser/extensions/api/resources_private/resources_private_api.h",
"shell/browser/extensions/api/runtime/electron_runtime_api_delegate.cc",
"shell/browser/extensions/api/runtime/electron_runtime_api_delegate.h",
"shell/browser/extensions/api/scripting/scripting_api.cc",
"shell/browser/extensions/api/scripting/scripting_api.h",
"shell/browser/extensions/api/streams_private/streams_private_api.cc",
"shell/browser/extensions/api/streams_private/streams_private_api.h",
"shell/browser/extensions/api/tabs/tabs_api.cc",
Expand Down
1 change: 1 addition & 0 deletions shell/browser/extensions/api/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function_registration("api_registration") {
sources = [
"//electron/shell/common/extensions/api/extension.json",
"//electron/shell/common/extensions/api/resources_private.idl",
"//electron/shell/common/extensions/api/scripting.idl",
"//electron/shell/common/extensions/api/tabs.json",
]

Expand Down
Loading

0 comments on commit 385065d

Please sign in to comment.