diff --git a/atom/common/options_switches.cc b/atom/common/options_switches.cc index 9d62dcfc9f79..a01cce5fd830 100644 --- a/atom/common/options_switches.cc +++ b/atom/common/options_switches.cc @@ -127,8 +127,7 @@ const char kOpenerID[] = "openerId"; const char kScrollBounce[] = "scrollBounce"; // Enable blink features. -// TODO(kevinsawicki) Rename to enableBlinkFeatures in 2.0 -const char kBlinkFeatures[] = "blinkFeatures"; +const char kBlinkFeatures[] = "enableBlinkFeatures"; // Disable blink features. const char kDisableBlinkFeatures[] = "disableBlinkFeatures"; diff --git a/atom/common/options_switches.h b/atom/common/options_switches.h index cdd55e457b8b..968c2ebd5404 100644 --- a/atom/common/options_switches.h +++ b/atom/common/options_switches.h @@ -64,7 +64,7 @@ extern const char kExperimentalFeatures[]; extern const char kExperimentalCanvasFeatures[]; extern const char kOpenerID[]; extern const char kScrollBounce[]; -extern const char kBlinkFeatures[]; +extern const char kEnableBlinkFeatures[]; extern const char kDisableBlinkFeatures[]; extern const char kNodeIntegrationInWorker[]; extern const char kWebviewTag[]; diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index a6dfe1d65876..2de0e12d9c3a 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -309,7 +309,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`. canvas features. Default is `false`. * `scrollBounce` Boolean (optional) - Enables scroll bounce (rubber banding) effect on macOS. Default is `false`. - * `blinkFeatures` String (optional) - A list of feature strings separated by `,`, like + * `enableBlinkFeatures` String (optional) - A list of feature strings separated by `,`, like `CSSVariables,KeyboardEventKey` to enable. The full list of supported feature strings can be found in the [RuntimeEnabledFeatures.json5][runtime-enabled-features] file. diff --git a/docs/api/webview-tag.md b/docs/api/webview-tag.md index 1d991ff2e697..614b3f50330a 100644 --- a/docs/api/webview-tag.md +++ b/docs/api/webview-tag.md @@ -214,10 +214,10 @@ A name by itself is given a `true` boolean value. A preference can be set to another value by including an `=`, followed by the value. Special values `yes` and `1` are interpreted as `true`, while `no` and `0` are interpreted as `false`. -### `blinkfeatures` +### `enableblinkfeatures` ```html - + ``` A list of strings which specifies the blink features to be enabled separated by `,`. diff --git a/docs/tutorial/planned-breaking-changes.md b/docs/tutorial/planned-breaking-changes.md index 6b7c996b24c3..42eed660ce9a 100644 --- a/docs/tutorial/planned-breaking-changes.md +++ b/docs/tutorial/planned-breaking-changes.md @@ -1,30 +1,3 @@ -# Planned Breaking API Changes (3.0) - -The following list includes the APIs that will be removed in Electron 3.0. - -There is no timetable for when this release will occur but deprecation -warnings will be added at least [one major version](electron-versioning.md#semver) beforehand. - -## `BrowserWindow` - -```js -// Deprecated -let optionsA = {webPreferences: {blinkFeatures: ''}} -let windowA = new BrowserWindow(optionsA) -// Replace with -let optionsB = {webPreferences: {enableBlinkFeatures: ''}} -let windowB = new BrowserWindow(optionsB) -``` - -## Node Headers URL - -This is the URL specified as `disturl` in a `.npmrc` file or as the `--dist-url` -command line flag when building native Node modules. - -Deprecated: https://atom.io/download/atom-shell - -Replace with: https://atom.io/download/electron - # Planned Breaking API Changes (4.0) The following list includes the APIs that will be removed in Electron 4.0. diff --git a/docs/tutorial/security.md b/docs/tutorial/security.md index 7d75e98c6895..451542151740 100644 --- a/docs/tutorial/security.md +++ b/docs/tutorial/security.md @@ -78,7 +78,7 @@ improve the security of your application. 7. [Override and disable `eval`](#7-override-and-disable-eval), which allows strings to be executed as code. 8. [Do not set `allowRunningInsecureContent` to `true`](#8-do-not-set-allowrunninginsecurecontent-to-true) 9. [Do not enable experimental features](#9-do-not-enable-experimental-features) -10. [Do not use `blinkFeatures`](#10-do-not-use-blinkfeatures) +10. [Do not use `enableBlinkFeatures`](#10-do-not-use-enableblinkfeatures) 11. [WebViews: Do not use `allowpopups`](#11-do-not-use-allowpopups) 12. [WebViews: Verify the options and params of all `` tags](#12-verify-webview-options-before-creation) @@ -452,12 +452,12 @@ const mainWindow = new BrowserWindow({}) ``` -## 10) Do Not Use `blinkFeatures` +## 10) Do Not Use `enableBlinkFeatures` _Recommendation is Electron's default_ Blink is the name of the rendering engine behind Chromium. As with -`experimentalFeatures`, the `blinkFeatures` property allows developers to +`experimentalFeatures`, the `enableBlinkFeatures` property allows developers to enable features that have been disabled by default. ### Why? @@ -473,7 +473,7 @@ no circumstances should you enable features speculatively. // Bad const mainWindow = new BrowserWindow({ webPreferences: { - blinkFeatures: ['ExecCommandInJavaScript'] + enableBlinkFeatures: ['ExecCommandInJavaScript'] } }) ``` diff --git a/lib/browser/guest-view-manager.js b/lib/browser/guest-view-manager.js index e7f620a6e291..a9a99fe2ea7d 100644 --- a/lib/browser/guest-view-manager.js +++ b/lib/browser/guest-view-manager.js @@ -217,7 +217,7 @@ const attachGuest = function (event, elementInstanceId, guestInstanceId, params) plugins: params.plugins, zoomFactor: embedder._getZoomFactor(), webSecurity: !params.disablewebsecurity, - blinkFeatures: params.blinkfeatures, + enableBlinkFeatures: params.blinkfeatures, disableBlinkFeatures: params.disableblinkfeatures } diff --git a/lib/renderer/init.js b/lib/renderer/init.js index 93129849ae04..2470a5e8be80 100644 --- a/lib/renderer/init.js +++ b/lib/renderer/init.js @@ -31,7 +31,7 @@ const { warnAboutDisabledWebSecurity, warnAboutInsecureContentAllowed, warnAboutExperimentalFeatures, - warnAboutBlinkFeatures, + warnAboutEnableBlinkFeatures, warnAboutInsecureResources, warnAboutInsecureCSP, warnAboutAllowedPopups, @@ -177,7 +177,7 @@ window.addEventListener('load', function loadHandler () { warnAboutInsecureResources() warnAboutInsecureContentAllowed() warnAboutExperimentalFeatures() - warnAboutBlinkFeatures() + warnAboutEnableBlinkFeatures() warnAboutInsecureCSP() warnAboutAllowedPopups() } diff --git a/lib/renderer/security-warnings.js b/lib/renderer/security-warnings.js index 4f7d6ef9e596..2f8ebee5bd07 100644 --- a/lib/renderer/security-warnings.js +++ b/lib/renderer/security-warnings.js @@ -229,23 +229,23 @@ module.exports = { }, /** - * #10 on the checklist: Do not use blinkFeatures + * #10 on the checklist: Do not use enableBlinkFeatures * - * Logs a warning message about blinkFeatures + * Logs a warning message about enableBlinkFeatures */ - warnAboutBlinkFeatures: () => { + warnAboutEnableBlinkFeatures: () => { const webPreferences = getWebPreferences() - if (!webPreferences || !webPreferences.blinkFeatures || - (webPreferences.blinkFeatures.length && webPreferences.blinkFeatures.length === 0)) { + if (!webPreferences || !webPreferences.enableBlinkFeatures || + (webPreferences.enableBlinkFeatures.length && webPreferences.enableBlinkFeatures.length === 0)) { return } - let warning = 'This renderer process has additional "blinkFeatures" ' + + let warning = 'This renderer process has additional "enableBlinkFeatures" ' + 'enabled. This exposes users of this app to some security risk. ' + 'If you do not need this feature, you should disable it.\n' + moreInformation - console.warn('%cElectron Security Warning (blinkFeatures)', + console.warn('%cElectron Security Warning (enableBlinkFeatures)', 'font-weight: bold;', warning) },