|
@@ -273,6 +273,27 @@ const warnAboutContextIsolationDefault = function (webPreferences) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+const warnAboutDeprecatedWebviewTagDefault = function (webPreferences) {
|
|
|
+ if (webPreferences.webviewTagWasExplicitlyEnabled) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!document || !document.getElementsByTagName) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const webviews = document.getElementsByTagName('webview')
|
|
|
+ if (webviews && webviews.length > 0) {
|
|
|
+ const url = 'https://github.com/electron/electron/blob/master/docs/api/breaking-changes.md#new-browserwindow-webpreferences-'
|
|
|
+ const warning = `This window has the <webview> tag enabled by default. In ` +
|
|
|
+ `Electron 5.0.0, <webview> tags will be disabled by default. To prepare ` +
|
|
|
+ `for this change, set {webviewTag: true} in the webPreferences for ` +
|
|
|
+ `this window.\n\n` +
|
|
|
+ `For more information, see ${url}`
|
|
|
+
|
|
|
+ console.warn('%cElectron Deprecation Warning (webviewTag default change)',
|
|
|
+ 'font-weight: bold;', warning)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
// Currently missing since we can't easily programmatically check for it:
|
|
|
// #12WebViews: Verify the options and params of all `<webview>` tags
|
|
|
|
|
@@ -287,6 +308,7 @@ const logSecurityWarnings = function (webPreferences, nodeIntegration) {
|
|
|
warnAboutAllowedPopups()
|
|
|
warnAboutNodeIntegrationDefault(webPreferences)
|
|
|
warnAboutContextIsolationDefault(webPreferences)
|
|
|
+ warnAboutDeprecatedWebviewTagDefault(webPreferences)
|
|
|
}
|
|
|
|
|
|
const getWebPreferences = function () {
|