[Extensions] Don't allow extensions to inject scripts into extension pages
commitc318b93de2ee7b8cc78e506dd2dd161af7d6819d
authorrdevlin.cronin <rdevlin.cronin@chromium.org>
Mon, 14 Sep 2015 20:22:29 +0000 (14 13:22 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 14 Sep 2015 20:23:05 +0000 (14 20:23 +0000)
tree076ab3bc9618002243884a071f1309a8596ecc6c
parentfafe071bac241504791c2904af9fbfea476274c8
[Extensions] Don't allow extensions to inject scripts into extension pages

Don't allow extensions to inject scripts into other extension pages, since this
is a security risk. This was meant to be addressed, but there was an incorrect
early-return. Also add a regression test.

BUG=529682

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

Cr-Commit-Position: refs/heads/master@{#348707}
12 files changed:
chrome/browser/extensions/content_script_apitest.cc
chrome/test/data/extensions/api_test/content_scripts/background_page_iframe/background.html [new file with mode: 0644]
chrome/test/data/extensions/api_test/content_scripts/background_page_iframe/background.js [new file with mode: 0644]
chrome/test/data/extensions/api_test/content_scripts/background_page_iframe/manifest.json [new file with mode: 0644]
chrome/test/data/extensions/api_test/content_scripts/script_a_com/manifest.json [new file with mode: 0644]
chrome/test/data/extensions/api_test/content_scripts/script_a_com/script.js [new file with mode: 0644]
extensions/renderer/extension_injection_host.cc
extensions/renderer/script_injection.cc
extensions/renderer/script_injection.h
extensions/renderer/script_injection_manager.cc
extensions/renderer/user_script_injector.cc
extensions/renderer/user_script_set.cc