Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support chrome.scripting extension APIs #39395

Merged
merged 1 commit into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
54 changes: 40 additions & 14 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,25 @@ 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`

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

- `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,12 +114,24 @@ 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`

The following methods of `chrome.storage` 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`

The following methods of `chrome.tabs` are supported:
Expand All @@ -111,23 +148,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`

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

- `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 @@ -714,6 +714,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