mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
[mv3] Add test suite list to available rulesets
Microsoft Edge for Android requires a "link to the core function test cases for your Edge Android extension" to verify that the extension function properly.
This commit is contained in:
parent
31d82c494b
commit
536f0fba25
2 changed files with 23 additions and 6 deletions
|
|
@ -233,7 +233,10 @@ async function fetchList(assetDetails) {
|
|||
continue;
|
||||
}
|
||||
fetchedURLs.add(part.url);
|
||||
if ( part.url.startsWith('https://ublockorigin.github.io/uAssets/filters/') ) {
|
||||
if (
|
||||
assetDetails.trustedSource ||
|
||||
part.url.startsWith('https://ublockorigin.github.io/uAssets/filters/')
|
||||
) {
|
||||
newParts.push(`!#trusted on ${secret}`);
|
||||
}
|
||||
newParts.push(
|
||||
|
|
@ -248,7 +251,7 @@ async function fetchList(assetDetails) {
|
|||
return { url, content };
|
||||
}
|
||||
}
|
||||
log(`No valid content for ${details.name}`, false);
|
||||
log(`No valid content for ${url}`, false);
|
||||
return { url, content: '' };
|
||||
})
|
||||
);
|
||||
|
|
@ -1464,6 +1467,17 @@ async function main() {
|
|||
homeURL: 'https://github.com/StevenBlack/hosts#readme',
|
||||
});
|
||||
|
||||
await rulesetFromURLs({
|
||||
id: 'ubol-tests',
|
||||
name: 'uBO Lite Test Filters',
|
||||
enabled: false,
|
||||
trusted: true,
|
||||
urls: [ 'https://ublockorigin.github.io/uBOL-home/tests/test-filters.txt' ],
|
||||
homeURL: 'https://ublockorigin.github.io/uBOL-home/tests/test-filters.html',
|
||||
filters: [
|
||||
],
|
||||
});
|
||||
|
||||
// Regional rulesets
|
||||
const excludedLists = [
|
||||
'ara-0',
|
||||
|
|
|
|||
|
|
@ -55,15 +55,18 @@ const hnParts = [];
|
|||
try {
|
||||
let origin = document.location.origin;
|
||||
if ( origin === 'null' ) {
|
||||
const origins = document.location.ancestorOrigins;
|
||||
const origins = document.location.ancestorOrigins || [];
|
||||
for ( let i = 0; i < origins.length; i++ ) {
|
||||
origin = origins[i];
|
||||
if ( origin !== 'null' ) { break; }
|
||||
}
|
||||
}
|
||||
const pos = origin.lastIndexOf('://');
|
||||
if ( pos === -1 ) { return; }
|
||||
hnParts.push(...origin.slice(pos+3).split('.'));
|
||||
const beg = origin.lastIndexOf('://');
|
||||
if ( beg === -1 ) { return; }
|
||||
let hn = origin.slice(beg+3)
|
||||
const end = hn.indexOf(':');
|
||||
if ( end !== -1 ) { hn = hn.slice(0, end); }
|
||||
hnParts.push(...hn.split('.'));
|
||||
} catch {
|
||||
}
|
||||
const hnpartslen = hnParts.length;
|
||||
|
|
|
|||
Loading…
Reference in a new issue