fix: check process.isMainFrame in sandboxed_renderer/init.js (#16500)
This commit is contained in:
parent
e6952e2a16
commit
fef262f829
2 changed files with 7 additions and 3 deletions
|
@ -17,7 +17,7 @@ function handleFocusBlur (guestInstanceId) {
|
|||
}
|
||||
|
||||
module.exports = function (contextIsolation, webviewTag, guestInstanceId) {
|
||||
// Load webview tag implementation.
|
||||
// Don't allow recursive `<webview>`.
|
||||
if (webviewTag && guestInstanceId == null) {
|
||||
const webViewImpl = require('@electron/internal/renderer/web-view/web-view-impl')
|
||||
if (contextIsolation) {
|
||||
|
|
|
@ -127,7 +127,9 @@ switch (window.location.protocol) {
|
|||
const guestInstanceId = binding.guestInstanceId && parseInt(binding.guestInstanceId)
|
||||
|
||||
// Load webview tag implementation.
|
||||
if (process.isMainFrame) {
|
||||
require('@electron/internal/renderer/web-view/web-view-init')(contextIsolation, isWebViewTagEnabled, guestInstanceId)
|
||||
}
|
||||
|
||||
const errorUtils = require('@electron/internal/common/error-utils')
|
||||
|
||||
|
@ -176,4 +178,6 @@ try {
|
|||
}
|
||||
|
||||
// Warn about security issues
|
||||
if (process.isMainFrame) {
|
||||
require('@electron/internal/renderer/security-warnings')()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue