mirror of https://github.com/gorhill/uBlock.git
fix #3386
This commit is contained in:
parent
d8d1fa5221
commit
ce696e5fbe
|
@ -113,11 +113,14 @@
|
||||||
return matches[1].trim() + ':style(' + matches[2].trim() + ')';
|
return matches[1].trim() + ':style(' + matches[2].trim() + ')';
|
||||||
};
|
};
|
||||||
|
|
||||||
var toASCIIHostname = function(hostname) {
|
var toASCIIHostnames = function(hostnames) {
|
||||||
if ( hostname.charCodeAt(0) === 0x7E /* '~' */ ) {
|
var i = hostnames.length;
|
||||||
return '~' + punycode.toASCII(hostname.slice(1));
|
while ( i-- ) {
|
||||||
|
var hostname = hostnames[i];
|
||||||
|
hostnames[i] = hostname.charCodeAt(0) === 0x7E /* '~' */ ?
|
||||||
|
'~' + punycode.toASCII(hostname.slice(1)) :
|
||||||
|
punycode.toASCII(hostname);
|
||||||
}
|
}
|
||||||
return punycode.toASCII(hostname);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var compileProceduralSelector = (function() {
|
var compileProceduralSelector = (function() {
|
||||||
|
@ -631,9 +634,7 @@
|
||||||
var prefix = raw.slice(0, lpos);
|
var prefix = raw.slice(0, lpos);
|
||||||
parsed.hostnames = prefix.split(reHostnameSeparator);
|
parsed.hostnames = prefix.split(reHostnameSeparator);
|
||||||
if ( reHasUnicode.test(prefix) ) {
|
if ( reHasUnicode.test(prefix) ) {
|
||||||
for ( var hostname of parsed.hostnames ) {
|
toASCIIHostnames(parsed.hostnames);
|
||||||
parsed.hostnames = toASCIIHostname(hostname);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue