diff options
author | rob@robwu.nl <rob@robwu.nl@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-15 16:40:16 +0000 |
---|---|---|
committer | rob@robwu.nl <rob@robwu.nl@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-15 16:40:16 +0000 |
commit | ae26b2816790d49ec72fbd4fa4e11fe1a44bed99 (patch) | |
tree | a73432788e71bb2a73c3a0a3668edca7a5b7c8e7 /extensions/common/user_script.cc | |
parent | 7a61377589cc2a20af5dcffcfe0df723f6da31fb (diff) | |
download | chromium_src-ae26b2816790d49ec72fbd4fa4e11fe1a44bed99.zip chromium_src-ae26b2816790d49ec72fbd4fa4e11fe1a44bed99.tar.gz chromium_src-ae26b2816790d49ec72fbd4fa4e11fe1a44bed99.tar.bz2 |
Allow content script insertion on about:-URLs.
Adds a new key content_scripts[*].match_about_blank and
InjectionDetails.matchAboutBlank.
If true, content scripts will also be inserted in about:* frames
provided that its origin matches a pattern in the extension permissions.
BUG=76429,55084,146789
TEST=browser_tests: ExtensionApiTest.ContentScriptAboutBlank*:ScriptContextTest.GetEffectiveDocumentURL
Review URL: https://codereview.chromium.org/226663003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270690 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions/common/user_script.cc')
-rw-r--r-- | extensions/common/user_script.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/extensions/common/user_script.cc b/extensions/common/user_script.cc index 84c1236..4f51504 100644 --- a/extensions/common/user_script.cc +++ b/extensions/common/user_script.cc @@ -69,9 +69,11 @@ UserScript::File::File() {} UserScript::File::~File() {} UserScript::UserScript() - : run_location_(DOCUMENT_IDLE), emulate_greasemonkey_(false), - match_all_frames_(false), incognito_enabled_(false) { -} + : run_location_(DOCUMENT_IDLE), + emulate_greasemonkey_(false), + match_all_frames_(false), + match_about_blank_(false), + incognito_enabled_(false) {} UserScript::~UserScript() { } @@ -127,6 +129,7 @@ void UserScript::Pickle(::Pickle* pickle) const { pickle->WriteString(extension_id()); pickle->WriteBool(emulate_greasemonkey()); pickle->WriteBool(match_all_frames()); + pickle->WriteBool(match_about_blank()); pickle->WriteBool(is_incognito_enabled()); PickleGlobs(pickle, globs_); @@ -175,6 +178,7 @@ void UserScript::Unpickle(const ::Pickle& pickle, PickleIterator* iter) { CHECK(pickle.ReadString(iter, &extension_id_)); CHECK(pickle.ReadBool(iter, &emulate_greasemonkey_)); CHECK(pickle.ReadBool(iter, &match_all_frames_)); + CHECK(pickle.ReadBool(iter, &match_about_blank_)); CHECK(pickle.ReadBool(iter, &incognito_enabled_)); UnpickleGlobs(pickle, iter, &globs_); |