| Index: extensions/renderer/programmatic_script_injector.cc
|
| diff --git a/extensions/renderer/programmatic_script_injector.cc b/extensions/renderer/programmatic_script_injector.cc
|
| index 6e28bef510a3b53c1648f1dc96af66181df9c2d0..5e668ac49c38c05544827618680731d1c92abd5a 100644
|
| --- a/extensions/renderer/programmatic_script_injector.cc
|
| +++ b/extensions/renderer/programmatic_script_injector.cc
|
| @@ -70,6 +70,10 @@ PermissionsData::AccessType ProgrammaticScriptInjector::CanExecuteOnFrame(
|
| blink::WebFrame* frame,
|
| int tab_id,
|
| const GURL& top_url) const {
|
| + // It doesn't make sense to inject a script into a remote frame or a frame
|
| + // with a null document.
|
| + if (frame->isWebRemoteFrame() || frame->document().isNull())
|
| + return PermissionsData::ACCESS_DENIED;
|
| GURL effective_document_url = ScriptContext::GetEffectiveDocumentURL(
|
| frame, frame->document().url(), params_->match_about_blank);
|
| if (params_->is_web_view) {
|
|
|