Commit dfebefe6 authored by kalman's avatar kalman Committed by Commit bot

[Extensions] Skip injecting scripts into remote frames with site isolation turned on.

This is admitting defeat by site isolation, for now. It's better than crashing.
It will be properly fixed when permission checks are moved into the browser.

BUG=454917
R=rdevlin.cronin@chromium.org

Review URL: https://codereview.chromium.org/1018163002

Cr-Commit-Position: refs/heads/master@{#321254}
parent 5e148eb4
...@@ -204,11 +204,18 @@ scoped_ptr<ScriptInjection> UserScriptSet::GetInjectionForScript( ...@@ -204,11 +204,18 @@ scoped_ptr<ScriptInjection> UserScriptSet::GetInjectionForScript(
scoped_ptr<ScriptInjector> injector(new UserScriptInjector(script, scoped_ptr<ScriptInjector> injector(new UserScriptInjector(script,
this, this,
is_declarative)); is_declarative));
if (injector->CanExecuteOnFrame(
injection_host.get(), blink::WebDocument top_document = web_frame->top()->document();
web_frame, // This can be null if site isolation is turned on. The best we can do is to
-1, // Content scripts are not tab-specific. // just give up - generally the wrong behavior, but better than crashing.
web_frame->top()->document().url()) == // TODO(kalman): Fix this properly by moving all security checks into the
// browser. See http://crbug.com/466373 for ongoing work here.
if (top_document.isNull())
return injection.Pass();
if (injector->CanExecuteOnFrame(injection_host.get(), web_frame,
-1, // Content scripts are not tab-specific.
top_document.url()) ==
PermissionsData::ACCESS_DENIED) { PermissionsData::ACCESS_DENIED) {
return injection.Pass(); return injection.Pass();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment