Add isolated world web preference option

This commit is contained in:
Kevin Sawicki 2016-12-08 15:33:51 -08:00
parent cdf33ff3dc
commit 4bca6fe672
3 changed files with 7 additions and 0 deletions

View file

@ -119,6 +119,11 @@ void WebContentsPreferences::AppendExtraCommandLineSwitches(
LOG(ERROR) << "preload url must be file:// protocol.";
}
// Run Electron APIs and preload script in isolated world
bool isolated;
if (web_preferences.GetBoolean("isolated", &isolated) && isolated)
command_line->AppendSwitch(switches::kIsolatedWorld);
// --background-color.
std::string color;
if (web_preferences.GetString(options::kBackgroundColor, &color))

View file

@ -163,6 +163,7 @@ const char kZoomFactor[] = "zoom-factor";
const char kPreloadScript[] = "preload";
const char kPreloadURL[] = "preload-url";
const char kNodeIntegration[] = "node-integration";
const char kIsolatedWorld[] = "isolated-world";
const char kGuestInstanceID[] = "guest-instance-id";
const char kOpenerID[] = "opener-id";
const char kScrollBounce[] = "scroll-bounce";

View file

@ -86,6 +86,7 @@ extern const char kZoomFactor[];
extern const char kPreloadScript[];
extern const char kPreloadURL[];
extern const char kNodeIntegration[];
extern const char kIsolatedWorld[];
extern const char kGuestInstanceID[];
extern const char kOpenerID[];
extern const char kScrollBounce[];