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

@ -20,9 +20,9 @@ function handleFocusBlur () {
});
}
export function webViewInit (contextIsolation: boolean, webviewTag: boolean, guestInstanceId: number) {
export function webViewInit (contextIsolation: boolean, webviewTag: boolean, isWebView: boolean) {
// Don't allow recursive `<webview>`.
if (webviewTag && !guestInstanceId) {
if (webviewTag && !isWebView) {
const guestViewInternal = require('@electron/internal/renderer/web-view/guest-view-internal') as typeof guestViewInternalModule;
if (contextIsolation) {
v8Util.setHiddenValue(window, 'guestViewInternal', guestViewInternal);
@ -36,7 +36,7 @@ export function webViewInit (contextIsolation: boolean, webviewTag: boolean, gue
}
}
if (guestInstanceId) {
if (isWebView) {
// Report focus/blur events of webview to browser.
handleFocusBlur();
}