further fix #2950: FF56 also suffers non-punycoded URLs

This commit is contained in:
gorhill 2017-09-02 11:56:59 -04:00
parent 8116afabc4
commit 40cfd1505e
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 4 additions and 4 deletions

View File

@ -32,7 +32,7 @@ vAPI.net.registerListeners = function() {
// https://github.com/gorhill/uBlock/issues/2950
// Firefox 55 does not normalize URLs to ASCII, uBO must do this itself.
// https://bugzilla.mozilla.org/show_bug.cgi?id=945240
var belowFirefox56 = false;
var mustPunycode = false;
(function() {
if (
typeof browser === 'object' &&
@ -41,8 +41,8 @@ vAPI.net.registerListeners = function() {
typeof browser.runtime.getBrowserInfo === 'function'
) {
browser.runtime.getBrowserInfo().then(info => {
belowFirefox56 = info.name === 'Firefox' &&
/^5[0-5]\./.test(info.version);
mustPunycode = info.name === 'Firefox' &&
/^5[0-6]\./.test(info.version);
});
}
})();
@ -100,7 +100,7 @@ vAPI.net.registerListeners = function() {
details.tabId = details.tabId.toString();
if (
belowFirefox56 === true &&
mustPunycode === true &&
reMustNormalizeHostname.test(details.url) === true
) {
parsedURL.href = details.url;