Add option to override webview security
This commit is contained in:
parent
b4a8ed01f1
commit
94d054cf11
7 changed files with 64 additions and 2 deletions
|
@ -101,6 +101,13 @@ void WebContentsPreferences::AppendExtraCommandLineSwitches(
|
|||
if (web_preferences.GetBoolean(options::kNodeIntegrationInWorker, &b) && b)
|
||||
command_line->AppendSwitch(switches::kNodeIntegrationInWorker);
|
||||
|
||||
// Check if webview tag creation is overriden.
|
||||
bool enable_webview_override = false;
|
||||
web_preferences.GetBoolean(options::kEnableWebViewOverride,
|
||||
&enable_webview_override);
|
||||
command_line->AppendSwitchASCII(switches::kEnableWebViewOverride,
|
||||
enable_webview_override ? "true" : "false");
|
||||
|
||||
// If the `sandbox` option was passed to the BrowserWindow's webPreferences,
|
||||
// pass `--enable-sandbox` to the renderer so it won't have any node.js
|
||||
// integration.
|
||||
|
|
|
@ -128,6 +128,9 @@ const char kDisableBlinkFeatures[] = "disableBlinkFeatures";
|
|||
// Enable the node integration in WebWorker.
|
||||
const char kNodeIntegrationInWorker[] = "nodeIntegrationInWorker";
|
||||
|
||||
// Enable the web view tag irrespective of node-integration setting.
|
||||
const char kEnableWebViewOverride[] = "enableWebViewOverride";
|
||||
|
||||
} // namespace options
|
||||
|
||||
namespace switches {
|
||||
|
@ -172,6 +175,7 @@ const char kGuestInstanceID[] = "guest-instance-id";
|
|||
const char kOpenerID[] = "opener-id";
|
||||
const char kScrollBounce[] = "scroll-bounce";
|
||||
const char kHiddenPage[] = "hidden-page";
|
||||
const char kEnableWebViewOverride[] = "enable-webview-override";
|
||||
|
||||
// Command switch passed to renderer process to control nodeIntegration.
|
||||
const char kNodeIntegrationInWorker[] = "node-integration-in-worker";
|
||||
|
|
|
@ -64,6 +64,7 @@ extern const char kScrollBounce[];
|
|||
extern const char kBlinkFeatures[];
|
||||
extern const char kDisableBlinkFeatures[];
|
||||
extern const char kNodeIntegrationInWorker[];
|
||||
extern const char kEnableWebViewOverride[];
|
||||
|
||||
} // namespace options
|
||||
|
||||
|
@ -93,6 +94,7 @@ extern const char kOpenerID[];
|
|||
extern const char kScrollBounce[];
|
||||
extern const char kHiddenPage[];
|
||||
extern const char kNodeIntegrationInWorker[];
|
||||
extern const char kEnableWebViewOverride[];
|
||||
|
||||
extern const char kWidevineCdmPath[];
|
||||
extern const char kWidevineCdmVersion[];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue