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

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

Issue 1867363003: Better support for patterns. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback Created 4 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: 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 31310a6701ec141149b9e01dd3d19ae52b27bb97..e15c22119c977d4c201fc00bd1798b81db4f97ad 100644
--- a/chrome/browser/resources/settings/site_settings/site_settings_behavior.js
+++ b/chrome/browser/resources/settings/site_settings/site_settings_behavior.js
@@ -284,6 +284,16 @@ var SiteSettingsBehaviorImpl = {
return '';
}
},
+
+ /**
+ * Ensures the URL has a scheme (assumes http if omitted).
+ * @param {string} url The URL with or without a scheme.
+ * @return {string} The URL with a scheme, or an empty string.
+ */
+ ensureUrlHasScheme: function(url) {
+ if (url.length == 0) return url;
+ return url.includes('://') ? url : 'http://' + url;
+ },
};
/** @polymerBehavior */

Powered by Google App Engine
This is Rietveld 408576698