summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-18 22:13:32 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-18 22:13:32 +0000
commitb9c9d58dbb1e4ef201f3230f78c3755b4c96bf9a (patch)
treeb2615f7b94a1f14d48bb2e910fbe0e3e8fff0382
parent1ea8b13da3556cc2678bd8071ffffd23f9a05b6d (diff)
downloadchromium_src-b9c9d58dbb1e4ef201f3230f78c3755b4c96bf9a.zip
chromium_src-b9c9d58dbb1e4ef201f3230f78c3755b4c96bf9a.tar.gz
chromium_src-b9c9d58dbb1e4ef201f3230f78c3755b4c96bf9a.tar.bz2
Ignore requests to run content scripts on file:// urls.
We currently throw an error when loading the extension, which is overly aggressive. BUG=28158 TEST=Specify matches=file://* in the manifest for a content script and make sure the extension still loads. Review URL: http://codereview.chromium.org/402069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32415 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/common/extensions/extension.cc3
-rw-r--r--chrome/common/extensions/extension_constants.cc2
-rw-r--r--chrome/common/extensions/extension_constants.h1
3 files changed, 1 insertions, 5 deletions
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index d07ba80..7b39253 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -253,8 +253,7 @@ bool Extension::LoadUserScriptHelper(const DictionaryValue* content_script,
// was provided.
if (!CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableJsOnFileUrls)) {
- *error = errors::kInvalidJsMatches;
- return false;
+ continue;
}
}
diff --git a/chrome/common/extensions/extension_constants.cc b/chrome/common/extensions/extension_constants.cc
index fc16fea..733b4f8 100644
--- a/chrome/common/extensions/extension_constants.cc
+++ b/chrome/common/extensions/extension_constants.cc
@@ -91,8 +91,6 @@ const char* kInvalidJs =
"Invalid value for 'content_scripts[*].js[*]'.";
const char* kInvalidJsList =
"Required value 'content_scripts[*].js is invalid.";
-const char* kInvalidJsMatches =
- "Content scripts can not be executed on file:// urls.";
const char* kInvalidKey =
"Value 'key' is missing or invalid.";
const char* kInvalidManifest =
diff --git a/chrome/common/extensions/extension_constants.h b/chrome/common/extensions/extension_constants.h
index b0765b4..c8a717a 100644
--- a/chrome/common/extensions/extension_constants.h
+++ b/chrome/common/extensions/extension_constants.h
@@ -77,7 +77,6 @@ namespace extension_manifest_errors {
extern const char* kInvalidGlob;
extern const char* kInvalidJs;
extern const char* kInvalidJsList;
- extern const char* kInvalidJsMatches;
extern const char* kInvalidKey;
extern const char* kInvalidManifest;
extern const char* kInvalidMatchCount;