This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var isExternalUrl = function (url) { | |
/* Tests if valid absolute url, ex: | |
* http://www.google.com | https://www.google.com | //www.google.com | |
*/ | |
if (new RegExp('^((https?:)?//)', 'i').test(url)) { | |
var target = document.createElement('a'); | |
target.href = url; | |
// note: hostname will be empty in IE for local urls | |
if (target.hostname.length > 0 && |