Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove nativeWindowOpen option #29405

Merged
merged 12 commits into from Jan 6, 2022
54 changes: 0 additions & 54 deletions docs/api/browser-window-proxy.md

This file was deleted.

12 changes: 12 additions & 0 deletions docs/breaking-changes.md
Expand Up @@ -12,6 +12,18 @@ This document uses the following convention to categorize breaking changes:
* **Deprecated:** An API was marked as deprecated. The API will continue to function, but will emit a deprecation warning, and will be removed in a future release.
* **Removed:** An API or feature was removed, and is no longer supported by Electron.

## Planned Breaking API Changes (18.0)

### Removed: `nativeWindowOpen`

Prior to Electron 15, `window.open` was by default shimmed to use
`BrowserWindowProxy`. This meant that `window.open('about:blank')` did not work
to open synchronously scriptable child windows, among other incompatibilities.
Sice Electron 15 `nativeWindowOpen` was enabled by default.
miniak marked this conversation as resolved.
Show resolved Hide resolved

See the documentation for [window.open in Electron](api/window-open.md)
for more details.

## Planned Breaking API Changes (17.0)

### Removed: `desktopCapturer.getSources` in the renderer
Expand Down
1 change: 0 additions & 1 deletion lib/browser/guest-view-manager.ts
Expand Up @@ -56,7 +56,6 @@ function makeWebPreferences (embedder: Electron.WebContents, params: Record<stri
const inheritedWebPreferences = new Map([
['contextIsolation', true],
['javascript', false],
['nativeWindowOpen', true],
['nodeIntegration', false],
['sandbox', true],
['nodeIntegrationInSubFrames', false],
Expand Down
213 changes: 0 additions & 213 deletions lib/browser/guest-window-proxy.ts

This file was deleted.

Expand Up @@ -8,10 +8,10 @@ WebPreferences of in-process child windows, rather than relying on
process-level command line switches, as before.

diff --git a/third_party/blink/common/web_preferences/web_preferences.cc b/third_party/blink/common/web_preferences/web_preferences.cc
index 8a1315f7f89588bb21c6d3c21a7de7c07fed9679..4753d99506cfc68d0095da660f28742e6a6a4118 100644
index db2d0536ed7a8143a60cebf1c5d7fee1acf4d10d..0cad8646e8b733a3a2d4b1076fdb0276bcd5b7bf 100644
--- a/third_party/blink/common/web_preferences/web_preferences.cc
+++ b/third_party/blink/common/web_preferences/web_preferences.cc
@@ -148,6 +148,20 @@ WebPreferences::WebPreferences()
@@ -145,6 +145,20 @@ WebPreferences::WebPreferences()
fake_no_alloc_direct_call_for_testing_enabled(false),
v8_cache_options(blink::mojom::V8CacheOptions::kDefault),
record_whole_document(false),
Expand All @@ -33,7 +33,7 @@ index 8a1315f7f89588bb21c6d3c21a7de7c07fed9679..4753d99506cfc68d0095da660f28742e
accelerated_video_decode_enabled(false),
animation_policy(
diff --git a/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc b/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc
index a264ef99beb81dd6b1f55c1b0f57f6055b4ab771..1631d8450bd6684b5c78c14bbc724f537149c9a8 100644
index e9f2e215ee1220c66549112982df04201c68fe1a..e9118530b395dbb13180365521dcf03d9ca211e5 100644
--- a/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc
+++ b/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc
@@ -23,6 +23,10 @@ bool StructTraits<blink::mojom::WebPreferencesDataView,
Expand All @@ -47,7 +47,7 @@ index a264ef99beb81dd6b1f55c1b0f57f6055b4ab771..1631d8450bd6684b5c78c14bbc724f53
!data.ReadLazyFrameLoadingDistanceThresholdsPx(
&out->lazy_frame_loading_distance_thresholds_px) ||
!data.ReadLazyImageLoadingDistanceThresholdsPx(
@@ -156,6 +160,19 @@ bool StructTraits<blink::mojom::WebPreferencesDataView,
@@ -158,6 +162,19 @@ bool StructTraits<blink::mojom::WebPreferencesDataView,
data.fake_no_alloc_direct_call_for_testing_enabled();
out->v8_cache_options = data.v8_cache_options();
out->record_whole_document = data.record_whole_document();
Expand All @@ -68,7 +68,7 @@ index a264ef99beb81dd6b1f55c1b0f57f6055b4ab771..1631d8450bd6684b5c78c14bbc724f53
out->accelerated_video_decode_enabled =
data.accelerated_video_decode_enabled();
diff --git a/third_party/blink/public/common/web_preferences/web_preferences.h b/third_party/blink/public/common/web_preferences/web_preferences.h
index 4517bf43c1b80f1aa0f3ba8e67e78b8b91e19f8a..4f4abe22e0732f64e11a449f6cbb79a139b048c6 100644
index 0d74719b2f8fb91f094772fab96a880cc8787c77..23126786a738c3fe83f7064bf8b597794d871ac5 100644
--- a/third_party/blink/public/common/web_preferences/web_preferences.h
+++ b/third_party/blink/public/common/web_preferences/web_preferences.h
@@ -10,6 +10,7 @@
Expand All @@ -79,7 +79,7 @@ index 4517bf43c1b80f1aa0f3ba8e67e78b8b91e19f8a..4f4abe22e0732f64e11a449f6cbb79a1
#include "net/nqe/effective_connection_type.h"
#include "third_party/blink/public/common/common_export.h"
#include "third_party/blink/public/mojom/css/preferred_color_scheme.mojom-shared.h"
@@ -162,6 +163,22 @@ struct BLINK_COMMON_EXPORT WebPreferences {
@@ -163,6 +164,22 @@ struct BLINK_COMMON_EXPORT WebPreferences {
blink::mojom::V8CacheOptions v8_cache_options;
bool record_whole_document;

Expand All @@ -103,7 +103,7 @@ index 4517bf43c1b80f1aa0f3ba8e67e78b8b91e19f8a..4f4abe22e0732f64e11a449f6cbb79a1
// only controls whether or not the "document.cookie" field is properly
// connected to the backing store, for instance if you wanted to be able to
diff --git a/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h b/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h
index 9dbbb581a8876430c3e0a39df1ff655d3ddc6d2d..2c369f97e84f10a4c3915a7874b64985286e5aa3 100644
index e0084598921ddcb0cf2aeb33875f05da0b5457e9..bcda6f35ad74b2b8aa9d439155048aab7bd02b21 100644
--- a/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h
+++ b/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h
@@ -6,6 +6,7 @@
Expand All @@ -114,7 +114,7 @@ index 9dbbb581a8876430c3e0a39df1ff655d3ddc6d2d..2c369f97e84f10a4c3915a7874b64985
#include "mojo/public/cpp/bindings/struct_traits.h"
#include "net/nqe/effective_connection_type.h"
#include "third_party/blink/public/common/common_export.h"
@@ -451,6 +452,60 @@ struct BLINK_COMMON_EXPORT StructTraits<blink::mojom::WebPreferencesDataView,
@@ -456,6 +457,60 @@ struct BLINK_COMMON_EXPORT StructTraits<blink::mojom::WebPreferencesDataView,
return r.record_whole_document;
}

Expand Down Expand Up @@ -176,7 +176,7 @@ index 9dbbb581a8876430c3e0a39df1ff655d3ddc6d2d..2c369f97e84f10a4c3915a7874b64985
return r.cookie_enabled;
}
diff --git a/third_party/blink/public/mojom/webpreferences/web_preferences.mojom b/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
index eaecb8c2b7dadaf7650bc8ac85cbad4383035e67..b906c00e984eec38a12df929bef15cb0afe8ca51 100644
index af5ba07466b95ab61befdd3994d731ed8f7ef0a6..5ffa7ef2334da800267af3947e68477bf82f3526 100644
--- a/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
+++ b/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
@@ -10,6 +10,7 @@ import "third_party/blink/public/mojom/v8_cache_options.mojom";
Expand All @@ -187,7 +187,7 @@ index eaecb8c2b7dadaf7650bc8ac85cbad4383035e67..b906c00e984eec38a12df929bef15cb0

enum PointerType {
kPointerNone = 1, // 1 << 0
@@ -214,6 +215,22 @@ struct WebPreferences {
@@ -215,6 +216,22 @@ struct WebPreferences {
V8CacheOptions v8_cache_options;
bool record_whole_document;

Expand Down
3 changes: 1 addition & 2 deletions shell/browser/api/electron_api_browser_view.cc
Expand Up @@ -81,8 +81,7 @@ BrowserView::BrowserView(gin::Arguments* args,

v8::Local<v8::Value> value;

// Copy the webContents option to webPreferences. This is only used internally
// to implement nativeWindowOpen option.
// Copy the webContents option to webPreferences.
if (options.Get("webContents", &value)) {
web_preferences.SetHidden("webContents", value);
}
Expand Down