summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-22 02:25:04 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-22 02:25:04 +0000
commit62771440ed73d5f6f8b322ad5f7a2fa1837e8da9 (patch)
tree79e5441b6b2674afe18778fb42ba35a8166cae1b /chrome/common
parent98586a039c29ac0e4cfac919e5071c371563c770 (diff)
downloadchromium_src-62771440ed73d5f6f8b322ad5f7a2fa1837e8da9.zip
chromium_src-62771440ed73d5f6f8b322ad5f7a2fa1837e8da9.tar.gz
chromium_src-62771440ed73d5f6f8b322ad5f7a2fa1837e8da9.tar.bz2
Revert change that disallowed content scripts access to
file:// URLs. It turns out teams were already depending on this and we didn't want to break them. Instead, group file:// access with NPAPI in the extension install prompt. Note: this is a pure revert of r402029 and r402069 (sorry Finnur!) except the changes in extension_install_ui.cc, which are new. BUG=28456 Review URL: http://codereview.chromium.org/430003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32770 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/chrome_switches.cc4
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome/common/extensions/docs/content_scripts.html3
-rw-r--r--chrome/common/extensions/docs/static/content_scripts.html3
-rw-r--r--chrome/common/extensions/extension.cc13
5 files changed, 2 insertions, 22 deletions
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 9230067..bc23ce5 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -191,10 +191,6 @@ const char kEnableFastback[] = "enable-fastback";
// testing, for example page cycler and layout tests. See bug 1157243.
const char kEnableFileCookies[] = "enable-file-cookies";
-// By default, js content scripts are not allowed on file://. They are needed
-// for page cycler tests. See http://crbug.com/27877.
-const char kEnableJsOnFileUrls[] = "enable-content-script-on-file-urls";
-
// Disable LocalStorage.
const char kDisableLocalStorage[] = "disable-local-storage";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 1402cb5..f521615 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -70,7 +70,6 @@ extern const char kEnableExperimentalWebGL[];
extern const char kEnableExtensionTimelineApi[];
extern const char kEnableFastback[];
extern const char kEnableFileCookies[];
-extern const char kEnableJsOnFileUrls[];
extern const char kDisableLocalStorage[];
extern const char kEnableLogging[];
extern const char kEnableMonitorProfile[];
diff --git a/chrome/common/extensions/docs/content_scripts.html b/chrome/common/extensions/docs/content_scripts.html
index 96b5b65..a20dcd9 100644
--- a/chrome/common/extensions/docs/content_scripts.html
+++ b/chrome/common/extensions/docs/content_scripts.html
@@ -321,9 +321,6 @@ They <b>cannot</b>:
<li>
Make cross-site XMLHttpRequests
</li>
- <li>
- Execute on file:// urls.
- </li>
</ul>
<p>
diff --git a/chrome/common/extensions/docs/static/content_scripts.html b/chrome/common/extensions/docs/static/content_scripts.html
index 80d1fc4..0c5bcd9 100644
--- a/chrome/common/extensions/docs/static/content_scripts.html
+++ b/chrome/common/extensions/docs/static/content_scripts.html
@@ -40,9 +40,6 @@ They <b>cannot</b>:
<li>
Make cross-site XMLHttpRequests
</li>
- <li>
- Execute on file:// urls.
- </li>
</ul>
<p>
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 93428a58..ce31c80 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -244,20 +244,11 @@ bool Extension::LoadUserScriptHelper(const DictionaryValue* content_script,
IntToString(definition_index), IntToString(j));
return false;
}
- std::string scheme = pattern.scheme();
- if (scheme == "file") {
- // No content scripts are allowed unless the command line override switch
- // was provided.
- if (!CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableJsOnFileUrls)) {
- continue;
- }
- }
result->add_url_pattern(pattern);
}
- // Include/exclude globs (mostly for Greasemonkey compatibility).
+ // include/exclude globs (mostly for Greasemonkey compat)
if (!LoadGlobsHelper(content_script, definition_index, keys::kIncludeGlobs,
error, &UserScript::add_glob, result)) {
return false;
@@ -268,7 +259,7 @@ bool Extension::LoadUserScriptHelper(const DictionaryValue* content_script,
return false;
}
- // js and css keys.
+ // js and css keys
ListValue* js = NULL;
if (content_script->HasKey(keys::kJs) &&
!content_script->GetList(keys::kJs, &js)) {