mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
Use native Punycode conversion (#3854)
This commit is contained in:
parent
430537632c
commit
f316a326cf
@ -29,11 +29,10 @@ import { createRequire } from 'module';
|
|||||||
|
|
||||||
import { readFileSync } from 'fs';
|
import { readFileSync } from 'fs';
|
||||||
import { dirname, resolve } from 'path';
|
import { dirname, resolve } from 'path';
|
||||||
import { fileURLToPath } from 'url';
|
import { domainToASCII, fileURLToPath } from 'url';
|
||||||
|
|
||||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||||
|
|
||||||
import punycode from './lib/punycode.js';
|
|
||||||
import publicSuffixList from './lib/publicsuffixlist/publicsuffixlist.js';
|
import publicSuffixList from './lib/publicsuffixlist/publicsuffixlist.js';
|
||||||
|
|
||||||
import snfe from './js/static-net-filtering.js';
|
import snfe from './js/static-net-filtering.js';
|
||||||
@ -76,7 +75,7 @@ async function enableWASM() {
|
|||||||
|
|
||||||
function pslInit(raw) {
|
function pslInit(raw) {
|
||||||
if ( typeof raw === 'string' && raw.trim() !== '' ) {
|
if ( typeof raw === 'string' && raw.trim() !== '' ) {
|
||||||
publicSuffixList.parse(raw, punycode.toASCII);
|
publicSuffixList.parse(raw, domainToASCII);
|
||||||
return publicSuffixList;
|
return publicSuffixList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,7 +103,7 @@ function pslInit(raw) {
|
|||||||
console.error('Unable to populate public suffix list');
|
console.error('Unable to populate public suffix list');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
publicSuffixList.parse(raw, punycode.toASCII);
|
publicSuffixList.parse(raw, domainToASCII);
|
||||||
return publicSuffixList;
|
return publicSuffixList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user