chore: disable the remote module in devtools / chrome extension background scripts (#16866)

* cache isRemoteModuleEnabled

* chore: disable the remote module in devtools / chrome extension background scripts
This commit is contained in:
Milan Burda 2019-02-11 21:42:37 +01:00 committed by John Kleinschmidt
parent a3cdf46fb6
commit d8ba1278d1
6 changed files with 20 additions and 17 deletions

View file

@ -1960,6 +1960,9 @@ v8::Local<v8::Value> WebContents::GetLastWebPreferences(
}
bool WebContents::IsRemoteModuleEnabled() const {
if (web_contents()->GetVisibleURL().SchemeIs("chrome-devtools")) {
return false;
}
if (auto* web_preferences = WebContentsPreferences::From(web_contents())) {
return web_preferences->IsRemoteModuleEnabled();
}