chore: upgrade to Node.js v14.9.0 (#25249)

This commit is contained in:
Shelley Vohr
2020-09-17 16:08:57 -06:00
committed by GitHub
parent 4d1dab849f
commit 77038b7bda
66 changed files with 724 additions and 1343 deletions

View File

@@ -1068,21 +1068,19 @@ shell.writeShortcutLink('/home/user/Desktop/shortcut.lnk', 'update', shell.readS
// cookies
// https://github.com/electron/electron/blob/master/docs/api/cookies.md
{
const { session } = require('electron')
// Query all cookies.
session.defaultSession.cookies.get({})
.then((cookies) => {
.then(cookies => {
console.log(cookies)
}).catch((error) => {
}).catch((error: Error) => {
console.log(error)
})
// Query all cookies associated with a specific url.
session.defaultSession.cookies.get({ url: 'http://www.github.com' })
.then((cookies) => {
.then(cookies => {
console.log(cookies)
}).catch((error) => {
}).catch((error: Error) => {
console.log(error)
})
@@ -1092,7 +1090,7 @@ shell.writeShortcutLink('/home/user/Desktop/shortcut.lnk', 'update', shell.readS
session.defaultSession.cookies.set(cookie)
.then(() => {
// success
}, (error) => {
}, (error: Error) => {
console.error(error)
})
}

View File

@@ -1,5 +1,6 @@
import {
desktopCapturer,
ipcRenderer,
remote,
webFrame,
@@ -33,16 +34,16 @@ remote.getCurrentWindow().on('close', () => {
// blabla...
})
remote.getCurrentWindow().capturePage().then(buf => {
fs.writeFile('/tmp/screenshot.png', buf, err => {
remote.getCurrentWindow().capturePage().then(image => {
fs.writeFile('/tmp/screenshot.png', image.toBitmap(), err => {
console.log(err)
})
})
remote.getCurrentWebContents().print()
remote.getCurrentWindow().capturePage().then(buf => {
remote.require('fs').writeFile('/tmp/screenshot.png', buf, (err: Error) => {
remote.getCurrentWindow().capturePage().then(image => {
remote.require('fs').writeFile('/tmp/screenshot.png', image.toBitmap(), (err: Error) => {
console.log(err)
})
})
@@ -107,8 +108,6 @@ crashReporter.start({
// desktopCapturer
// https://github.com/electron/electron/blob/master/docs/api/desktop-capturer.md
const desktopCapturer = require('electron').desktopCapturer
desktopCapturer.getSources({ types: ['window', 'screen'] }).then(sources => {
for (let i = 0; i < sources.length; ++i) {
if (sources[i].name == 'Electron') {