Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
[Script Injection] Allow whitelisted extensions to inject scripts eve…
Browse files Browse the repository at this point in the history
…rywhere

Fix a regression where whitelisted extensions couldn't inject content scripts on
other extension pages.

BUG=517370
TBR=kalman@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#345382}
(cherry picked from commit 29d2ec9)

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

Cr-Commit-Position: refs/branch-heads/2490@{#185}
Cr-Branched-From: 7790a35-refs/heads/master@{#344925}
  • Loading branch information
rdcronin committed Sep 8, 2015
1 parent 54aca2c commit de4836c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion extensions/renderer/extension_injection_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ PermissionsData::AccessType ExtensionInjectionHost::CanExecuteOnFrame(

blink::WebSecurityOrigin top_frame_security_origin =
render_frame->GetWebFrame()->top()->securityOrigin();
// Only whitelisted extensions may run scripts on another extension's page.
if (top_frame_security_origin.protocol().utf8() == kExtensionScheme &&
top_frame_security_origin.host().utf8() != extension_->id())
top_frame_security_origin.host().utf8() != extension_->id() &&
!PermissionsData::CanExecuteScriptEverywhere(extension_))
return PermissionsData::ACCESS_DENIED;

// Declarative user scripts use "page access" (from "permissions" section in
Expand Down

0 comments on commit de4836c

Please sign in to comment.