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..5815450035f42b6b6ab4a5d0fcf8a230d8d41d11 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. |
michaelpg
2016/04/11 03:55:35
... or the empty string
Finnur
2016/04/11 11:45:33
Done.
|
+ */ |
+ ensureUrlHasScheme: function(url) { |
+ if (url.length == 0) return url; |
+ return url.indexOf('://') != -1 ? url : 'http://' + url; |
michaelpg
2016/04/11 03:55:35
url.includes
Finnur
2016/04/11 11:45:33
Done.
|
+ }, |
}; |
/** @polymerBehavior */ |