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 */ |