chore: remove deprecated extension APIs (#26696)

This commit is contained in:
Milan Burda 2020-11-30 23:40:56 +01:00 committed by GitHub
parent 7d49ce898a
commit 19954126e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 43 additions and 156 deletions

View file

@ -723,94 +723,6 @@ Returns `BrowserWindow | null` - The window that owns the given `browserView`. I
Returns `BrowserWindow | null` - The window with the given `id`.
#### `BrowserWindow.addExtension(path)` _Deprecated_
* `path` String
Adds Chrome extension located at `path`, and returns extension's name.
The method will also not return if the extension's manifest is missing or incomplete.
**Note:** This API cannot be called before the `ready` event of the `app` module
is emitted.
**Note:** This method is deprecated. Instead, use
[`ses.loadExtension(path)`](session.md#sesloadextensionpath).
#### `BrowserWindow.removeExtension(name)` _Deprecated_
* `name` String
Remove a Chrome extension by name.
**Note:** This API cannot be called before the `ready` event of the `app` module
is emitted.
**Note:** This method is deprecated. Instead, use
[`ses.removeExtension(extension_id)`](session.md#sesremoveextensionextensionid).
#### `BrowserWindow.getExtensions()` _Deprecated_
Returns `Record<String, ExtensionInfo>` - The keys are the extension names and each value is
an Object containing `name` and `version` properties.
**Note:** This API cannot be called before the `ready` event of the `app` module
is emitted.
**Note:** This method is deprecated. Instead, use
[`ses.getAllExtensions()`](session.md#sesgetallextensions).
#### `BrowserWindow.addDevToolsExtension(path)` _Deprecated_
* `path` String
Adds DevTools extension located at `path`, and returns extension's name.
The extension will be remembered so you only need to call this API once, this
API is not for programming use. If you try to add an extension that has already
been loaded, this method will not return and instead log a warning to the
console.
The method will also not return if the extension's manifest is missing or incomplete.
**Note:** This API cannot be called before the `ready` event of the `app` module
is emitted.
**Note:** This method is deprecated. Instead, use
[`ses.loadExtension(path)`](session.md#sesloadextensionpath).
#### `BrowserWindow.removeDevToolsExtension(name)` _Deprecated_
* `name` String
Remove a DevTools extension by name.
**Note:** This API cannot be called before the `ready` event of the `app` module
is emitted.
**Note:** This method is deprecated. Instead, use
[`ses.removeExtension(extension_id)`](session.md#sesremoveextensionextensionid).
#### `BrowserWindow.getDevToolsExtensions()` _Deprecated_
Returns `Record<string, ExtensionInfo>` - The keys are the extension names and each value is
an Object containing `name` and `version` properties.
To check if a DevTools extension is installed you can run the following:
```javascript
const { BrowserWindow } = require('electron')
const installed = 'devtron' in BrowserWindow.getDevToolsExtensions()
console.log(installed)
```
**Note:** This API cannot be called before the `ready` event of the `app` module
is emitted.
**Note:** This method is deprecated. Instead, use
[`ses.getAllExtensions()`](session.md#sesgetallextensions).
### Instance Properties
Objects created with `new BrowserWindow` have the following properties: