mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-11 09:31:01 +01:00
fix #3386
This commit is contained in:
parent
d8d1fa5221
commit
ce696e5fbe
1 changed files with 8 additions and 7 deletions
|
@ -113,11 +113,14 @@
|
|||
return matches[1].trim() + ':style(' + matches[2].trim() + ')';
|
||||
};
|
||||
|
||||
var toASCIIHostname = function(hostname) {
|
||||
if ( hostname.charCodeAt(0) === 0x7E /* '~' */ ) {
|
||||
return '~' + punycode.toASCII(hostname.slice(1));
|
||||
var toASCIIHostnames = function(hostnames) {
|
||||
var i = hostnames.length;
|
||||
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() {
|
||||
|
@ -631,9 +634,7 @@
|
|||
var prefix = raw.slice(0, lpos);
|
||||
parsed.hostnames = prefix.split(reHostnameSeparator);
|
||||
if ( reHasUnicode.test(prefix) ) {
|
||||
for ( var hostname of parsed.hostnames ) {
|
||||
parsed.hostnames = toASCIIHostname(hostname);
|
||||
}
|
||||
toASCIIHostnames(parsed.hostnames);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue