Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3331)

Unified Diff: chrome/common/extensions/extension.cc

Issue 430003: Revert change that disallowed content scripts access to file:// (Closed)
Patch Set: Can't go back, only through Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/extension.cc
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 7b39253bd637079e2dbd624c349cfba2188aeece..d054a0c801f790cbf72e2aa2f03568ff4253dd35 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -247,20 +247,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;
@@ -271,7 +262,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)) {

Powered by Google App Engine
This is Rietveld 408576698