mirror of https://github.com/gorhill/uBlock.git
fix bad regex: all URLs were seen as needing punycoding
This commit is contained in:
parent
5626b5005a
commit
04a41d8b22
|
@ -93,16 +93,13 @@ vAPI.net.registerListeners = function() {
|
|||
};
|
||||
|
||||
var punycode = self.punycode;
|
||||
var reMustNormalizeHostname = /[^0-9a-z._-]/;
|
||||
var reAsciiHostname = /^https?:\/\/[0-9a-z_.:@-]+[/?#]/;
|
||||
var parsedURL = new URL('about:blank');
|
||||
|
||||
var normalizeRequestDetails = function(details) {
|
||||
details.tabId = details.tabId.toString();
|
||||
|
||||
if (
|
||||
mustPunycode === true &&
|
||||
reMustNormalizeHostname.test(details.url) === true
|
||||
) {
|
||||
if ( mustPunycode && !reAsciiHostname.test(details.url) ) {
|
||||
parsedURL.href = details.url;
|
||||
details.url = details.url.replace(
|
||||
parsedURL.hostname,
|
||||
|
|
Loading…
Reference in New Issue