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

Unified Diff: extensions/common/url_pattern.cc

Issue 226663003: Allow content script insertion on about:-URLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove permission warning for about:-scheme Created 6 years, 8 months 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: extensions/common/url_pattern.cc
diff --git a/extensions/common/url_pattern.cc b/extensions/common/url_pattern.cc
index 477d3ddf080f65ea762dad056e27b11622d213cc..7cf1b8ce94c65bad16ae7ca82d783f7b5667e40a 100644
--- a/extensions/common/url_pattern.cc
+++ b/extensions/common/url_pattern.cc
@@ -27,6 +27,7 @@ const char* kValidSchemes[] = {
content::kChromeUIScheme,
extensions::kExtensionScheme,
content::kFileSystemScheme,
+ content::kAboutScheme,
};
const int kValidSchemeMasks[] = {
@@ -37,6 +38,7 @@ const int kValidSchemeMasks[] = {
URLPattern::SCHEME_CHROMEUI,
URLPattern::SCHEME_EXTENSION,
URLPattern::SCHEME_FILESYSTEM,
+ URLPattern::SCHEME_ABOUT,
};
COMPILE_ASSERT(arraysize(kValidSchemes) == arraysize(kValidSchemeMasks),
@@ -409,6 +411,10 @@ bool URLPattern::MatchesPath(const std::string& test) const {
if (test + "/*" == path_escaped_)
return true;
+ // If the path is a wildcard, allow any path.
+ if (path_escaped_ == "*" || path_escaped_ == "/*")
not at google - send to devlin 2014/04/18 16:04:55 this will change host permissions beyond just abou
+ return true;
+
return MatchPattern(test, path_escaped_);
}

Powered by Google App Engine
This is Rietveld 408576698