refactor: pass isWebViewTagEnabled via ELECTRON_BROWSER_SANDBOX_LOAD (#16238)

This commit is contained in:
Milan Burda 2019-01-08 10:12:34 +01:00 committed by Alexey Kuzmin
parent 791d6de8b0
commit 5c250455ad
3 changed files with 6 additions and 4 deletions

View file

@ -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