docs: remove unnecessary enableBlinkFeatures (#28129)
* docs: remove unnecessary enableBlinkFeatures * docs: remove trailing comma
This commit is contained in:
parent
41fdf450b2
commit
45c4dd529f
1 changed files with 2 additions and 7 deletions
|
@ -197,9 +197,7 @@ be managed by using [ses.setPermissionCheckHandler(handler)](#sessetpermissionch
|
||||||
with the `serial` permission.
|
with the `serial` permission.
|
||||||
|
|
||||||
Because this is an experimental feature it is disabled by default. To enable this feature, you
|
Because this is an experimental feature it is disabled by default. To enable this feature, you
|
||||||
will need to use the `--enable-features=ElectronSerialChooser` command line switch. Additionally
|
will need to use the `--enable-features=ElectronSerialChooser` command line switch.
|
||||||
because this is an experimental Chromium feature you will need to set `enableBlinkFeatures: 'Serial'`
|
|
||||||
on the `webPreferences` property when opening a BrowserWindow.
|
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const { app, BrowserWindow } = require('electron')
|
const { app, BrowserWindow } = require('electron')
|
||||||
|
@ -210,10 +208,7 @@ app.commandLine.appendSwitch('enable-features', 'ElectronSerialChooser')
|
||||||
app.whenReady().then(() => {
|
app.whenReady().then(() => {
|
||||||
win = new BrowserWindow({
|
win = new BrowserWindow({
|
||||||
width: 800,
|
width: 800,
|
||||||
height: 600,
|
height: 600
|
||||||
webPreferences: {
|
|
||||||
enableBlinkFeatures: 'Serial'
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
win.webContents.session.on('select-serial-port', (event, portList, webContents, callback) => {
|
win.webContents.session.on('select-serial-port', (event, portList, webContents, callback) => {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue