refactor: use getWebPreference() for all options (#26531)

This commit is contained in:
Milan Burda 2020-11-23 20:39:08 +01:00 committed by GitHub
parent 854d2b1574
commit 6932e02eb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 20 additions and 51 deletions

View file

@ -276,7 +276,7 @@ const watchEmbedder = function (embedder: Electron.WebContents) {
const isWebViewTagEnabledCache = new WeakMap();
export const isWebViewTagEnabled = function (contents: Electron.WebContents) {
const isWebViewTagEnabled = function (contents: Electron.WebContents) {
if (!isWebViewTagEnabledCache.has(contents)) {
const webPreferences = contents.getLastWebPreferences() || {};
isWebViewTagEnabledCache.set(contents, !!webPreferences.webviewTag);