build: update to standard 14 (#24479)

This commit is contained in:
Samuel Attard 2020-07-09 10:18:49 -07:00 committed by GitHub
parent 9bd0fc5348
commit eb6616e4e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 495 additions and 665 deletions

View file

@ -12,10 +12,10 @@ the [`BrowserWindow`](browser-window.md) object. An example of accessing the
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow({ width: 800, height: 1500 })
const win = new BrowserWindow({ width: 800, height: 1500 })
win.loadURL('http://github.com')
let contents = win.webContents
const contents = win.webContents
console.log(contents)
```
@ -418,7 +418,7 @@ To only prevent the menu shortcuts, use
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow({ width: 800, height: 600 })
const win = new BrowserWindow({ width: 800, height: 600 })
win.webContents.on('before-input-event', (event, input) => {
// For example, only enable application menu keyboard shortcuts when
@ -665,7 +665,7 @@ app.whenReady().then(() => {
win = new BrowserWindow({ width: 800, height: 600 })
win.webContents.on('select-bluetooth-device', (event, deviceList, callback) => {
event.preventDefault()
let result = deviceList.find((device) => {
const result = deviceList.find((device) => {
return device.deviceName === 'test'
})
if (!result) {
@ -691,7 +691,7 @@ buffer.
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow({ webPreferences: { offscreen: true } })
const win = new BrowserWindow({ webPreferences: { offscreen: true } })
win.webContents.on('paint', (event, dirty, image) => {
// updateBitmap(dirty, image.getBitmap())
})
@ -907,7 +907,7 @@ Returns `String` - The URL of the current web page.
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow({ width: 800, height: 600 })
const win = new BrowserWindow({ width: 800, height: 600 })
win.loadURL('http://github.com').then(() => {
const currentURL = win.webContents.getURL()
console.log(currentURL)
@ -1372,7 +1372,7 @@ An example of `webContents.printToPDF`:
const { BrowserWindow } = require('electron')
const fs = require('fs')
let win = new BrowserWindow({ width: 800, height: 600 })
const win = new BrowserWindow({ width: 800, height: 600 })
win.loadURL('http://github.com')
win.webContents.on('did-finish-load', () => {
@ -1397,7 +1397,7 @@ creation:
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow()
const win = new BrowserWindow()
win.webContents.on('devtools-opened', () => {
win.webContents.addWorkSpace(__dirname)
})
@ -1718,7 +1718,7 @@ Returns `Promise<void>` - resolves if the page is saved.
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow()
const win = new BrowserWindow()
win.loadURL('https://github.com')