Ignore port number in url domain

This commit is contained in:
tophf 2015-04-07 11:56:50 +03:00
parent 83b2e1d53d
commit 8b29f5de43

View File

@ -115,7 +115,7 @@ function getDomains(url) {
if (url.indexOf("file:") == 0) { if (url.indexOf("file:") == 0) {
return []; return [];
} }
var d = /.*?:\/*([^\/]+)/.exec(url)[1]; var d = /.*?:\/*([^\/:]+)/.exec(url)[1];
var domains = [d]; var domains = [d];
while (d.indexOf(".") != -1) { while (d.indexOf(".") != -1) {
d = d.substring(d.indexOf(".") + 1); d = d.substring(d.indexOf(".") + 1);