refactor: remove guestInstanceId from WebPreferences (#30280)

* refactor: remove guestInstanceId from WebPreferences

* refactor: remove WebViewManager::GetEmbedder
This commit is contained in:
Milan Burda 2021-07-29 00:32:53 +02:00 committed by GitHub
parent c3abbdefdd
commit c5ad7ed0cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 53 additions and 71 deletions

View file

@ -127,7 +127,7 @@ const contextIsolation = mainFrame.getWebPreference('contextIsolation');
const webviewTag = mainFrame.getWebPreference('webviewTag');
const isHiddenPage = mainFrame.getWebPreference('hiddenPage');
const usesNativeWindowOpen = true;
const guestInstanceId = mainFrame.getWebPreference('guestInstanceId');
const isWebView = mainFrame.getWebPreference('isWebView');
const openerId = mainFrame.getWebPreference('openerId');
switch (window.location.protocol) {
@ -145,14 +145,14 @@ switch (window.location.protocol) {
default: {
// Override default web functions.
const { windowSetup } = require('@electron/internal/renderer/window-setup') as typeof windowSetupModule;
windowSetup(guestInstanceId, openerId, isHiddenPage, usesNativeWindowOpen);
windowSetup(isWebView, openerId, isHiddenPage, usesNativeWindowOpen);
}
}
// Load webview tag implementation.
if (process.isMainFrame) {
const { webViewInit } = require('@electron/internal/renderer/web-view/web-view-init') as typeof webViewInitModule;
webViewInit(contextIsolation, webviewTag, guestInstanceId);
webViewInit(contextIsolation, webviewTag, isWebView);
}
// Wrap the script into a function executed in global scope. It won't have