refactor: pass isWebViewTagEnabled via ELECTRON_BROWSER_SANDBOX_LOAD (#16238)
This commit is contained in:
parent
791d6de8b0
commit
5c250455ad
3 changed files with 6 additions and 4 deletions
|
@ -328,8 +328,8 @@ const isWebViewTagEnabledCache = new WeakMap()
|
|||
|
||||
const isWebViewTagEnabled = function (contents) {
|
||||
if (!isWebViewTagEnabledCache.has(contents)) {
|
||||
const value = contents.getLastWebPreferences().webviewTag
|
||||
isWebViewTagEnabledCache.set(contents, value)
|
||||
const webPreferences = contents.getLastWebPreferences() || {}
|
||||
isWebViewTagEnabledCache.set(contents, !!webPreferences.webviewTag)
|
||||
}
|
||||
|
||||
return isWebViewTagEnabledCache.get(contents)
|
||||
|
@ -437,3 +437,4 @@ const getEmbedder = function (guestInstanceId) {
|
|||
}
|
||||
|
||||
exports.getGuestForWebContents = getGuestForWebContents
|
||||
exports.isWebViewTagEnabled = isWebViewTagEnabled
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue