File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ function formatStackForPopup(stack) {
1717}
1818
1919function getBaseHostByUrl ( url ) {
20- var localUrlRegexp = / ( f i l e : \/ \/ .* ) | ( : \/ \/ [ ^ . : ] + ( [ \/ ? ] | $ ) ) / ;
21- var rootHostRegexp = / : \/ \/ ( ( [ \w - ] + \. \w + ) | ( \d + \. \d + \. \d + \. \d + ) | ( \w + : \w + : \w + : [ \w : ] + ) ) ( [ \/ ? ] | $ ) / ;
22- var subDomainRegexp = / : \/ \/ .* \. ( [ \w - ] + \. \w + ) ( [ \/ ? ] | $ ) / ;
20+ var localUrlRegexp = / ( f i l e : \/ \/ .* ) | ( : \/ \/ [ ^ . : ] + ( [ \/ ? ] | $ ) ) / ; // file://
21+ var rootHostRegexp = / : \/ \/ ( ( [ \w - ] + \. \w + ) | ( \d + \. \d + \. \d + \. \d + ) | ( \[ [ \w : ] + \] ) ) ( [ \/ ? : ] | $ ) / ; // domain.com | IPv4 | IPv6
22+ var subDomainRegexp = / : \/ \/ .* \. ( [ \w - ] + \. \w + ) ( [ \/ ? : ] | $ ) / ; // sub.domain.com
2323 return localUrlRegexp . exec ( url ) ? 'localhost' : ( rootHostRegexp . exec ( url ) || subDomainRegexp . exec ( url ) ) [ 1 ] ;
2424}
2525
You can’t perform that action at this time.
0 commit comments