fix: register webview in main world when using contextIsolation (#16067)
This commit is contained in:
parent
dbda1a1b05
commit
8584c2f14b
11 changed files with 56 additions and 20 deletions
|
@ -1,7 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const ipcRenderer = require('@electron/internal/renderer/ipc-renderer-internal')
|
||||
const WebViewImpl = require('@electron/internal/renderer/web-view/web-view')
|
||||
const { WebViewImpl } = require('@electron/internal/renderer/web-view/web-view')
|
||||
const webViewConstants = require('@electron/internal/renderer/web-view/web-view-constants')
|
||||
const errorUtils = require('@electron/internal/common/error-utils')
|
||||
|
||||
|
@ -86,13 +86,13 @@ class PartitionAttribute extends WebViewAttribute {
|
|||
|
||||
// The partition cannot change if the webview has already navigated.
|
||||
if (!this.webViewImpl.beforeFirstNavigation) {
|
||||
window.console.error(webViewConstants.ERROR_MSG_ALREADY_NAVIGATED)
|
||||
console.error(webViewConstants.ERROR_MSG_ALREADY_NAVIGATED)
|
||||
this.setValueIgnoreMutation(oldValue)
|
||||
return
|
||||
}
|
||||
if (newValue === 'persist:') {
|
||||
this.validPartitionId = false
|
||||
window.console.error(webViewConstants.ERROR_MSG_INVALID_PARTITION_ATTRIBUTE)
|
||||
console.error(webViewConstants.ERROR_MSG_INVALID_PARTITION_ATTRIBUTE)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue