| Index: chrome/common/extensions/extension.cc
|
| diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
|
| index aeda254063492cb5906fdddb529f9eca4ec454d4..daea76620e7be1352d4bf2558cc73580ab25b853 100644
|
| --- a/chrome/common/extensions/extension.cc
|
| +++ b/chrome/common/extensions/extension.cc
|
| @@ -3575,6 +3575,7 @@ bool Extension::HasMultipleUISurfaces() const {
|
| }
|
|
|
| bool Extension::CanExecuteScriptOnPage(const GURL& page_url,
|
| + const GURL& top_frame_url,
|
| int tab_id,
|
| const UserScript* script,
|
| std::string* error) const {
|
| @@ -3598,6 +3599,12 @@ bool Extension::CanExecuteScriptOnPage(const GURL& page_url,
|
| !CanExecuteScriptEverywhere())
|
| return false;
|
|
|
| + if (top_frame_url.SchemeIs(chrome::kExtensionScheme) &&
|
| + top_frame_url.GetOrigin() !=
|
| + GetBaseURLFromExtensionId(id()).GetOrigin() &&
|
| + !CanExecuteScriptEverywhere())
|
| + return false;
|
| +
|
| // If a tab ID is specified, try the tab-specific permissions.
|
| if (tab_id >= 0) {
|
| scoped_refptr<const PermissionSet> tab_permissions =
|
|
|