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

Unified Diff: chrome/browser/resources/settings/site_settings/site_settings_behavior.js

Issue 2309283002: Site Settings Desktop: Fix issues with entering URL patterns. (Closed)
Patch Set: Created 4 years, 3 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: chrome/browser/resources/settings/site_settings/site_settings_behavior.js
diff --git a/chrome/browser/resources/settings/site_settings/site_settings_behavior.js b/chrome/browser/resources/settings/site_settings/site_settings_behavior.js
index 41b78218eef240918572b51a990e1b065580f171..8c20f2c7ea92fd7507a27f208165c468412f629c 100644
--- a/chrome/browser/resources/settings/site_settings/site_settings_behavior.js
+++ b/chrome/browser/resources/settings/site_settings/site_settings_behavior.js
@@ -390,12 +390,14 @@ var SiteSettingsBehaviorImpl = {
},
/**
- * Adds the wildcard prefix to a pattern string.
+ * Adds the wildcard prefix to a pattern string (if missing).
* @param {string} pattern The pattern to add the wildcard to.
* @return {string} The resulting pattern.
* @private
*/
addPatternWildcard: function(pattern) {
+ if (pattern.indexOf('[*.]') > -1)
+ return pattern;
Finnur 2016/09/05 11:23:17 When the user manually enters a URL pattern with a
dschuyler 2016/09/06 18:20:29 Acknowledged.
if (pattern.startsWith('http://'))
return pattern.replace('http://', 'http://[*.]');
else if (pattern.startsWith('https://'))

Powered by Google App Engine
This is Rietveld 408576698