From 996d5aebc0c4e9fa7a4c7a19a272084a288551ed Mon Sep 17 00:00:00 2001 From: Carlos Valdez Date: Fri, 16 Aug 2019 11:58:11 -0700 Subject: [PATCH 01/13] increase awesomeness --- docs/tutorial/security.md | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/docs/tutorial/security.md b/docs/tutorial/security.md index 1e475b8a20592..2eb54a0f04ea3 100644 --- a/docs/tutorial/security.md +++ b/docs/tutorial/security.md @@ -27,17 +27,11 @@ see [SECURITY.md](https://github.com/electron/electron/tree/master/SECURITY.md) ## Chromium Security Issues and Upgrades -While Electron strives to support new versions of Chromium as soon as possible, -developers should be aware that upgrading is a serious undertaking - involving -hand-editing dozens or even hundreds of files. Given the resources and -contributions available today, Electron will often not be on the very latest -version of Chromium, lagging behind by several weeks or a few months. - -We feel that our current system of updating the Chromium component strikes an -appropriate balance between the resources we have available and the needs of -the majority of applications built on top of the framework. We definitely are -interested in hearing more about specific use cases from the people that build -things on top of Electron. Pull requests and contributions supporting this +Electron is now up to date with the latest chromium release. For more information, +see the [Electron blog](https://electronjs.org/blog/12-week-cadence). + +We are interested in hearing more about specific use cases from the people that +build things on top of Electron. Pull requests and contributions supporting this effort are always very welcome. ## Security Is Everyone's Responsibility From bfcdaeaea2e57f6b9253cb1e4158952884506cc1 Mon Sep 17 00:00:00 2001 From: Carlos Valdez Date: Fri, 16 Aug 2019 12:05:11 -0700 Subject: [PATCH 02/13] remove trailing whitespace --- docs/tutorial/security.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorial/security.md b/docs/tutorial/security.md index 2eb54a0f04ea3..59c60eac69574 100644 --- a/docs/tutorial/security.md +++ b/docs/tutorial/security.md @@ -27,7 +27,7 @@ see [SECURITY.md](https://github.com/electron/electron/tree/master/SECURITY.md) ## Chromium Security Issues and Upgrades -Electron is now up to date with the latest chromium release. For more information, +Electron is now up to date with the latest chromium release. For more information, see the [Electron blog](https://electronjs.org/blog/12-week-cadence). We are interested in hearing more about specific use cases from the people that From 2f046602f28457650a7e50ad7d1936b0c98c3bc3 Mon Sep 17 00:00:00 2001 From: Carlos Date: Fri, 16 Aug 2019 12:50:10 -0700 Subject: [PATCH 03/13] Update docs/tutorial/security.md Co-Authored-By: Mark Lee --- docs/tutorial/security.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorial/security.md b/docs/tutorial/security.md index 59c60eac69574..1229718939c93 100644 --- a/docs/tutorial/security.md +++ b/docs/tutorial/security.md @@ -27,7 +27,7 @@ see [SECURITY.md](https://github.com/electron/electron/tree/master/SECURITY.md) ## Chromium Security Issues and Upgrades -Electron is now up to date with the latest chromium release. For more information, +Electron keeps up to date with the latest stable Chromium release. For more information, see the [Electron blog](https://electronjs.org/blog/12-week-cadence). We are interested in hearing more about specific use cases from the people that From 358ba0187f95ed3d717a5c85cb2a0fff56f90ab9 Mon Sep 17 00:00:00 2001 From: Carlos Valdez Date: Fri, 16 Aug 2019 12:59:50 -0700 Subject: [PATCH 04/13] =?UTF-8?q?=E2=9C=82=EF=B8=8F=20extra=20lines?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/tutorial/security.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/tutorial/security.md b/docs/tutorial/security.md index 1229718939c93..2d9e8836f0949 100644 --- a/docs/tutorial/security.md +++ b/docs/tutorial/security.md @@ -30,10 +30,6 @@ see [SECURITY.md](https://github.com/electron/electron/tree/master/SECURITY.md) Electron keeps up to date with the latest stable Chromium release. For more information, see the [Electron blog](https://electronjs.org/blog/12-week-cadence). -We are interested in hearing more about specific use cases from the people that -build things on top of Electron. Pull requests and contributions supporting this -effort are always very welcome. - ## Security Is Everyone's Responsibility It is important to remember that the security of your Electron application is From ee269f696ab5f8d27ca6f0e5267c670133929210 Mon Sep 17 00:00:00 2001 From: Carlos Date: Fri, 16 Aug 2019 14:08:08 -0700 Subject: [PATCH 05/13] Update docs/tutorial/security.md Co-Authored-By: Samuel Attard --- docs/tutorial/security.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorial/security.md b/docs/tutorial/security.md index 2d9e8836f0949..76f6bad72129e 100644 --- a/docs/tutorial/security.md +++ b/docs/tutorial/security.md @@ -28,7 +28,7 @@ see [SECURITY.md](https://github.com/electron/electron/tree/master/SECURITY.md) ## Chromium Security Issues and Upgrades Electron keeps up to date with the latest stable Chromium release. For more information, -see the [Electron blog](https://electronjs.org/blog/12-week-cadence). +see the [Electron Release Cadence blog post](https://electronjs.org/blog/12-week-cadence). ## Security Is Everyone's Responsibility From 2bde4d98ecabe2e8a3408d0f6eac275f52ede99d Mon Sep 17 00:00:00 2001 From: Carlos Date: Fri, 16 Aug 2019 14:24:31 -0700 Subject: [PATCH 06/13] Update docs/tutorial/security.md Co-Authored-By: Samuel Attard --- docs/tutorial/security.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorial/security.md b/docs/tutorial/security.md index 76f6bad72129e..f8d4123d4b3ae 100644 --- a/docs/tutorial/security.md +++ b/docs/tutorial/security.md @@ -27,7 +27,7 @@ see [SECURITY.md](https://github.com/electron/electron/tree/master/SECURITY.md) ## Chromium Security Issues and Upgrades -Electron keeps up to date with the latest stable Chromium release. For more information, +Electron keeps up to date with alternating Chromium releases. For more information, see the [Electron Release Cadence blog post](https://electronjs.org/blog/12-week-cadence). ## Security Is Everyone's Responsibility From 8af1ddb40310938ed463e7e909d7f3676a681b71 Mon Sep 17 00:00:00 2001 From: Carlos Valdez Date: Tue, 20 Aug 2019 14:28:52 -0700 Subject: [PATCH 07/13] add in examples with small modifications --- docs/fiddles/accelerator/main.js | 28 +++++++++++++++++++ .../screen/fit-screen-external/main.js | 24 ++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 docs/fiddles/accelerator/main.js create mode 100644 docs/fiddles/screen/fit-screen-external/main.js diff --git a/docs/fiddles/accelerator/main.js b/docs/fiddles/accelerator/main.js new file mode 100644 index 0000000000000..7e4a44cb1aac2 --- /dev/null +++ b/docs/fiddles/accelerator/main.js @@ -0,0 +1,28 @@ +// Adding a global shortcut to electron +// +// For more info, see: +// https://electronjs.org/docs/api/screen + +const { app, globalShortcut, BrowserWindow } = require('electron') + +let mainWindow = null; + +app.on('ready', () => { + // Register a 'CommandOrControl+Y' shortcut listener. + globalShortcut.register('CommandOrControl+Y', () => { + // Do stuff when Y and either Command/Control is pressed. + console.log('creating new window...'); + mainWindow = new BrowserWindow({ + width: 800, + height: 600, + webPreferences: { + nodeIntegration: true + } + }); + + // and load the index.html of the app. + mainWindow.loadFile('index.html'); + }); + +}) + diff --git a/docs/fiddles/screen/fit-screen-external/main.js b/docs/fiddles/screen/fit-screen-external/main.js new file mode 100644 index 0000000000000..4a311fa30f10f --- /dev/null +++ b/docs/fiddles/screen/fit-screen-external/main.js @@ -0,0 +1,24 @@ +// Creating a window in the external display +// +// For more info, see: +// https://electronjs.org/docs/api/screen + +const electron = require('electron') +const { app, BrowserWindow } = require('electron') + +let win + +app.on('ready', () => { + let displays = electron.screen.getAllDisplays() + let externalDisplay = displays.find((display) => { + return display.bounds.x !== 0 || display.bounds.y !== 0 + }) + + if (externalDisplay) { + win = new BrowserWindow({ + x: externalDisplay.bounds.x + 50, + y: externalDisplay.bounds.y + 50 + }) + win.loadURL('https://electronjs.org') + } +}) \ No newline at end of file From 697b8a491c144346d9d49f3d7e3454f4f7d56459 Mon Sep 17 00:00:00 2001 From: Carlos Valdez Date: Tue, 20 Aug 2019 14:29:11 -0700 Subject: [PATCH 08/13] add in fiddle links --- docs/api/accelerator.md | 2 +- docs/api/screen.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/accelerator.md b/docs/api/accelerator.md index 7bbccd4bc54ee..0c7b652465b43 100644 --- a/docs/api/accelerator.md +++ b/docs/api/accelerator.md @@ -15,7 +15,7 @@ Shortcuts are registered with the [`globalShortcut`](global-shortcut.md) module using the [`register`](global-shortcut.md#globalshortcutregisteraccelerator-callback) method, i.e. -```javascript +```javascript fiddle='docs/fiddles/accelerator const { app, globalShortcut } = require('electron') app.on('ready', () => { diff --git a/docs/api/screen.md b/docs/api/screen.md index 290a4a690d63a..f351ad71c4114 100644 --- a/docs/api/screen.md +++ b/docs/api/screen.md @@ -27,7 +27,7 @@ app.on('ready', () => { Another example of creating a window in the external display: -```javascript +```javascript fiddle='docs/fiddles/screen/fit-screen-external const { app, BrowserWindow, screen } = require('electron') let win From 8939b26899c89ac6cb18a2a35acf49b5fbb31168 Mon Sep 17 00:00:00 2001 From: Carlos Valdez Date: Tue, 20 Aug 2019 14:51:37 -0700 Subject: [PATCH 09/13] change up accelerator --- docs/fiddles/accelerator/main.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/fiddles/accelerator/main.js b/docs/fiddles/accelerator/main.js index 7e4a44cb1aac2..05a85c9cabe1d 100644 --- a/docs/fiddles/accelerator/main.js +++ b/docs/fiddles/accelerator/main.js @@ -11,18 +11,18 @@ app.on('ready', () => { // Register a 'CommandOrControl+Y' shortcut listener. globalShortcut.register('CommandOrControl+Y', () => { // Do stuff when Y and either Command/Control is pressed. - console.log('creating new window...'); - mainWindow = new BrowserWindow({ - width: 800, - height: 600, - webPreferences: { - nodeIntegration: true - } - }); - - // and load the index.html of the app. - mainWindow.loadFile('index.html'); + console.log('shortcut...'); }); + mainWindow = new BrowserWindow({ + width: 800, + height: 600, + webPreferences: { + nodeIntegration: true + } + }); + + // and load the index.html of the app. + mainWindow.loadFile('index.html'); }) From 103d6578200849a9532ca2794c262c7d21669913 Mon Sep 17 00:00:00 2001 From: Carlos Valdez Date: Wed, 21 Aug 2019 09:47:34 -0700 Subject: [PATCH 10/13] fix typo --- docs/fiddles/accelerator/main.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/fiddles/accelerator/main.js b/docs/fiddles/accelerator/main.js index 05a85c9cabe1d..6e6b74cf1b1c6 100644 --- a/docs/fiddles/accelerator/main.js +++ b/docs/fiddles/accelerator/main.js @@ -16,10 +16,7 @@ app.on('ready', () => { mainWindow = new BrowserWindow({ width: 800, - height: 600, - webPreferences: { - nodeIntegration: true - } + height: 600 }); // and load the index.html of the app. From 010232b37d8aff53d7c80f4e2fadf455b1fa26e2 Mon Sep 17 00:00:00 2001 From: Carlos Date: Wed, 21 Aug 2019 09:47:47 -0700 Subject: [PATCH 11/13] Update docs/fiddles/screen/fit-screen-external/main.js Co-Authored-By: Charles Kerr --- docs/fiddles/screen/fit-screen-external/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/fiddles/screen/fit-screen-external/main.js b/docs/fiddles/screen/fit-screen-external/main.js index 4a311fa30f10f..1226ff0af558d 100644 --- a/docs/fiddles/screen/fit-screen-external/main.js +++ b/docs/fiddles/screen/fit-screen-external/main.js @@ -4,7 +4,7 @@ // https://electronjs.org/docs/api/screen const electron = require('electron') -const { app, BrowserWindow } = require('electron') +const { app, screen, BrowserWindow } = require('electron') let win @@ -21,4 +21,4 @@ app.on('ready', () => { }) win.loadURL('https://electronjs.org') } -}) \ No newline at end of file +}) From df84d32b27633b0cdfca5fc2cc7a277156fee26b Mon Sep 17 00:00:00 2001 From: Carlos Date: Wed, 21 Aug 2019 09:48:07 -0700 Subject: [PATCH 12/13] Update docs/fiddles/screen/fit-screen-external/main.js Co-Authored-By: Charles Kerr --- docs/fiddles/screen/fit-screen-external/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/fiddles/screen/fit-screen-external/main.js b/docs/fiddles/screen/fit-screen-external/main.js index 1226ff0af558d..1bfb8c12dbf93 100644 --- a/docs/fiddles/screen/fit-screen-external/main.js +++ b/docs/fiddles/screen/fit-screen-external/main.js @@ -9,7 +9,7 @@ const { app, screen, BrowserWindow } = require('electron') let win app.on('ready', () => { - let displays = electron.screen.getAllDisplays() + let displays = screen.getAllDisplays() let externalDisplay = displays.find((display) => { return display.bounds.x !== 0 || display.bounds.y !== 0 }) From 0b391cf739a69fc6729c2cbcf5e7a3bb569bab81 Mon Sep 17 00:00:00 2001 From: Carlos Valdez Date: Wed, 21 Aug 2019 10:58:52 -0700 Subject: [PATCH 13/13] fix missing backticks --- docs/api/accelerator.md | 2 +- docs/api/screen.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/accelerator.md b/docs/api/accelerator.md index 0c7b652465b43..db2535b100f19 100644 --- a/docs/api/accelerator.md +++ b/docs/api/accelerator.md @@ -15,7 +15,7 @@ Shortcuts are registered with the [`globalShortcut`](global-shortcut.md) module using the [`register`](global-shortcut.md#globalshortcutregisteraccelerator-callback) method, i.e. -```javascript fiddle='docs/fiddles/accelerator +```javascript fiddle='docs/fiddles/accelerator' const { app, globalShortcut } = require('electron') app.on('ready', () => { diff --git a/docs/api/screen.md b/docs/api/screen.md index f351ad71c4114..96d364ce5d333 100644 --- a/docs/api/screen.md +++ b/docs/api/screen.md @@ -27,7 +27,7 @@ app.on('ready', () => { Another example of creating a window in the external display: -```javascript fiddle='docs/fiddles/screen/fit-screen-external +```javascript fiddle='docs/fiddles/screen/fit-screen-external' const { app, BrowserWindow, screen } = require('electron') let win