mirror of
https://github.com/gorhill/uBlock.git
synced 2025-01-31 12:11:36 +01:00
Experimental Safari version of uBOL
Still unclear whether this is possible, many glitches and quirks requiring investigation.
This commit is contained in:
parent
2266473336
commit
b8c363e780
@ -1,30 +0,0 @@
|
||||
env:
|
||||
browser: true
|
||||
es2022: true
|
||||
extends: eslint:recommended
|
||||
parserOptions:
|
||||
sourceType: module
|
||||
rules:
|
||||
eqeqeq:
|
||||
- warn
|
||||
- always
|
||||
indent:
|
||||
- error
|
||||
- 4
|
||||
- ignoredNodes:
|
||||
- Program > BlockStatement
|
||||
- Program > ExpressionStatement > CallExpression > ArrowFunctionExpression > BlockStatement
|
||||
- Program > ExpressionStatement > CallExpression > FunctionExpression > BlockStatement
|
||||
- Program > IfStatement > BlockStatement
|
||||
- Program > VariableDeclaration > VariableDeclarator > CallExpression > ArrowFunctionExpression > BlockStatement
|
||||
- CallExpression > MemberExpression
|
||||
- ArrayExpression > *
|
||||
- ObjectExpression > *
|
||||
no-control-regex: off
|
||||
no-empty: off
|
||||
sort-imports: warn
|
||||
strict: warn
|
||||
globals:
|
||||
browser: readonly
|
||||
chrome: readonly
|
||||
vAPI: readonly
|
12
Makefile
12
Makefile
@ -2,7 +2,7 @@
|
||||
run_options := $(filter-out $@,$(MAKECMDGOALS))
|
||||
|
||||
.PHONY: all clean cleanassets test lint chromium opera firefox npm dig \
|
||||
mv3 mv3-quick mv3-chromium mv3-firefox \
|
||||
mv3 mv3-quick mv3-chromium mv3-firefox mv3-safari \
|
||||
compare maxcost medcost mincost modifiers record wasm
|
||||
|
||||
sources := $(wildcard assets/* assets/*/* dist/version src/* src/*/* src/*/*/* src/*/*/*/*)
|
||||
@ -33,10 +33,11 @@ dist/build/uBlock0.npm: tools/make-nodejs.sh $(sources) $(platform) $(assets)
|
||||
tools/make-npm.sh
|
||||
|
||||
# Build the Node.js package.
|
||||
npm: dist/build/uBlock0.npm
|
||||
npm: node_modules/
|
||||
npm install
|
||||
|
||||
lint: npm
|
||||
cd dist/build/uBlock0.npm && npm run lint
|
||||
npm run lint
|
||||
|
||||
test: npm
|
||||
cd dist/build/uBlock0.npm && npm run test
|
||||
@ -66,6 +67,11 @@ dist/build/uBOLite.firefox: tools/make-mv3.sh $(sources) $(platform)
|
||||
|
||||
mv3-firefox: dist/build/uBOLite.firefox
|
||||
|
||||
dist/build/uBOLite.safari: tools/make-mv3.sh $(sources) $(platform)
|
||||
tools/make-mv3.sh safari
|
||||
|
||||
mv3-safari: dist/build/uBOLite.safari
|
||||
|
||||
mv3-quick: tools/make-mv3.sh $(sources) $(platform)
|
||||
tools/make-mv3.sh quick
|
||||
|
||||
|
47
eslint.config.mjs
Normal file
47
eslint.config.mjs
Normal file
@ -0,0 +1,47 @@
|
||||
import js from "@eslint/js";
|
||||
import globals from "globals";
|
||||
import json from "@eslint/json";
|
||||
|
||||
export default [ {
|
||||
files: ["**/*.js", "**/*.mjs"],
|
||||
...js.configs.recommended,
|
||||
}, {
|
||||
files: ["**/*.js", "**/*.mjs"],
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.browser,
|
||||
browser: "readonly",
|
||||
chrome: "readonly",
|
||||
vAPI: "readonly",
|
||||
},
|
||||
sourceType: "module",
|
||||
},
|
||||
rules: {
|
||||
eqeqeq: ["warn", "always"],
|
||||
indent: ["error", 4, {
|
||||
ignoredNodes: [
|
||||
"Program > BlockStatement",
|
||||
"Program > ExpressionStatement > CallExpression > ArrowFunctionExpression > BlockStatement",
|
||||
"Program > ExpressionStatement > CallExpression > FunctionExpression > BlockStatement",
|
||||
"Program > IfStatement > BlockStatement",
|
||||
"Program > VariableDeclaration > VariableDeclarator > CallExpression > ArrowFunctionExpression > BlockStatement",
|
||||
"CallExpression > MemberExpression",
|
||||
"ArrayExpression > *",
|
||||
"ObjectExpression > *",
|
||||
],
|
||||
}],
|
||||
|
||||
"no-control-regex": "off",
|
||||
"no-empty": "off",
|
||||
"sort-imports": "warn",
|
||||
strict: "warn",
|
||||
},
|
||||
}, {
|
||||
files: ["**/*.mjs"],
|
||||
languageOptions: { sourceType: 'module' },
|
||||
}, {
|
||||
files: ["**/*.json"],
|
||||
ignores: ["package-lock.json"],
|
||||
language: "json/json",
|
||||
...json.configs.recommended,
|
||||
} ];
|
1123
package-lock.json
generated
Normal file
1123
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
27
package.json
Normal file
27
package.json
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "uBlock",
|
||||
"version": "1.0.0",
|
||||
"description": "npm dev tools",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"lint": "eslint src/js/*.js",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/gorhill/uBlock.git"
|
||||
},
|
||||
"author": "Raymond Hill",
|
||||
"license": "GPLv3",
|
||||
"bugs": {
|
||||
"url": "https://github.com/gorhill/uBlock/issues"
|
||||
},
|
||||
"homepage": "https://github.com/gorhill/uBlock#readme",
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.17.0",
|
||||
"@eslint/json": "^0.9.0",
|
||||
"eslint": "^9.17.0",
|
||||
"eslint-formatter-compact": "^8.40.0",
|
||||
"globals": "^15.14.0"
|
||||
}
|
||||
}
|
25
platform/mv3/chromium/ext-compat.js
Normal file
25
platform/mv3/chromium/ext-compat.js
Normal file
@ -0,0 +1,25 @@
|
||||
/*******************************************************************************
|
||||
|
||||
uBlock Origin Lite - a comprehensive, MV3-compliant content blocker
|
||||
Copyright (C) 2022-present Raymond Hill
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||
|
||||
Home: https://github.com/gorhill/uBlock
|
||||
*/
|
||||
|
||||
export const webext = self.chrome;
|
||||
|
||||
export const initiatorDomains = 'initiatorDomains';
|
||||
export const excludedInitiatorDomains = 'excludedInitiatorDomains';
|
@ -75,7 +75,7 @@ import { registerInjectables } from './scripting-manager.js';
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
const UBOL_ORIGIN = runtime.getURL('').replace(/\/$/, '');
|
||||
const UBOL_ORIGIN = runtime.getURL('').replace(/\/$/, '').toLowerCase();
|
||||
|
||||
const canShowBlockedCount = typeof dnr.setExtensionActionOptions === 'function';
|
||||
|
||||
@ -176,7 +176,9 @@ function onMessage(request, sender, callback) {
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/MessageSender
|
||||
// Firefox API does not set `sender.origin`
|
||||
if ( sender.origin !== undefined && sender.origin !== UBOL_ORIGIN ) { return; }
|
||||
if ( sender.origin !== undefined ) {
|
||||
if ( sender.origin.toLowerCase() !== UBOL_ORIGIN ) { return; }
|
||||
}
|
||||
|
||||
switch ( request.what ) {
|
||||
|
||||
|
@ -19,11 +19,17 @@
|
||||
Home: https://github.com/gorhill/uBlock
|
||||
*/
|
||||
|
||||
import { dnr } from './ext.js';
|
||||
import {
|
||||
INITIATOR_DOMAINS,
|
||||
dnr,
|
||||
} from './ext.js';
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
export const isSideloaded = dnr.onRuleMatchedDebug instanceof Object;
|
||||
const isModern = dnr.onRuleMatchedDebug instanceof Object;
|
||||
|
||||
export const isSideloaded = isModern ||
|
||||
typeof dnr.getMatchedRules === 'function';
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
@ -67,8 +73,8 @@ const getRuleset = async rulesetId => {
|
||||
if ( condition.requestDomains ) {
|
||||
condition.requestDomains = pruneLongLists(condition.requestDomains);
|
||||
}
|
||||
if ( condition.initiatorDomains ) {
|
||||
condition.initiatorDomains = pruneLongLists(condition.initiatorDomains);
|
||||
if ( condition[INITIATOR_DOMAINS] ) {
|
||||
condition[INITIATOR_DOMAINS] = pruneLongLists(condition[INITIATOR_DOMAINS]);
|
||||
}
|
||||
}
|
||||
const ruleId = rule.id;
|
||||
@ -92,6 +98,7 @@ export const getMatchedRules = (( ) => {
|
||||
const noopFn = ( ) => Promise.resolve([]);
|
||||
if ( isSideloaded !== true ) { return noopFn; }
|
||||
|
||||
if ( isModern ) {
|
||||
return async tabId => {
|
||||
const promises = [];
|
||||
for ( let i = 0; i < bufferSize; i++ ) {
|
||||
@ -107,6 +114,17 @@ export const getMatchedRules = (( ) => {
|
||||
}
|
||||
return Promise.all(promises);
|
||||
};
|
||||
}
|
||||
|
||||
return async tabId => {
|
||||
const matchedRules = await dnr.getMatchedRules({ tabId });
|
||||
if ( matchedRules instanceof Object === false ) { return []; }
|
||||
const out = [];
|
||||
for ( const ruleInfo of matchedRules.rulesMatchedInfo ) {
|
||||
out.push({ request: ruleInfo.request });
|
||||
}
|
||||
return out;
|
||||
};
|
||||
})();
|
||||
|
||||
/******************************************************************************/
|
||||
@ -118,6 +136,7 @@ const matchedRuleListener = ruleInfo => {
|
||||
|
||||
export const toggleDeveloperMode = state => {
|
||||
if ( isSideloaded !== true ) { return; }
|
||||
if ( isModern === false ) { return; }
|
||||
if ( state ) {
|
||||
dnr.onRuleMatchedDebug.addListener(matchedRuleListener);
|
||||
} else {
|
||||
|
@ -19,18 +19,24 @@
|
||||
Home: https://github.com/gorhill/uBlock
|
||||
*/
|
||||
|
||||
export const browser =
|
||||
self.browser instanceof Object &&
|
||||
self.browser instanceof Element === false
|
||||
? self.browser
|
||||
: self.chrome;
|
||||
import {
|
||||
excludedInitiatorDomains,
|
||||
initiatorDomains,
|
||||
webext,
|
||||
} from './ext-compat.js';
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
export const browser = webext;
|
||||
export const dnr = browser.declarativeNetRequest;
|
||||
export const i18n = browser.i18n;
|
||||
export const runtime = browser.runtime;
|
||||
export const TAB_ID_NONE = browser.tabs.TAB_ID_NONE;
|
||||
export const windows = browser.windows;
|
||||
|
||||
export const INITIATOR_DOMAINS = initiatorDomains;
|
||||
export const EXCLUDED_INITIATOR_DOMAINS = excludedInitiatorDomains;
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
// The extension's service worker can be evicted at any time, so when we
|
||||
@ -64,7 +70,7 @@ export async function localRead(key) {
|
||||
const bin = await browser.storage.local.get(key);
|
||||
if ( bin instanceof Object === false ) { return; }
|
||||
return bin[key] ?? undefined;
|
||||
} catch(ex) {
|
||||
} catch {
|
||||
}
|
||||
}
|
||||
|
||||
@ -89,7 +95,7 @@ export async function sessionRead(key) {
|
||||
const bin = await browser.storage.session.get(key);
|
||||
if ( bin instanceof Object === false ) { return; }
|
||||
return bin[key] ?? undefined;
|
||||
} catch(ex) {
|
||||
} catch {
|
||||
}
|
||||
}
|
||||
|
||||
@ -114,7 +120,7 @@ export async function adminRead(key) {
|
||||
const bin = await browser.storage.managed.get(key);
|
||||
if ( bin instanceof Object === false ) { return; }
|
||||
return bin[key] ?? undefined;
|
||||
} catch(ex) {
|
||||
} catch {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ async function commitFilteringMode() {
|
||||
granted = await browser.permissions.request({
|
||||
origins: [ `*://*.${targetHostname}/*` ],
|
||||
});
|
||||
} catch(ex) {
|
||||
} catch {
|
||||
}
|
||||
if ( granted !== true ) {
|
||||
setFilteringMode(beforeLevel);
|
||||
@ -287,7 +287,7 @@ dom.on('[data-i18n-title="popupTipReport"]', 'click', ev => {
|
||||
let url;
|
||||
try {
|
||||
url = new URL(currentTab.url);
|
||||
} catch(_) {
|
||||
} catch {
|
||||
}
|
||||
if ( url === undefined ) { return; }
|
||||
const reportURL = new URL(runtime.getURL('/report.html'));
|
||||
@ -325,7 +325,8 @@ async function init() {
|
||||
url = new URL(url.hash.slice(1));
|
||||
}
|
||||
tabURL.href = url.href || '';
|
||||
} catch(ex) {
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( url !== undefined ) {
|
||||
@ -391,11 +392,13 @@ async function init() {
|
||||
}
|
||||
|
||||
async function tryInit() {
|
||||
let success = false;
|
||||
try {
|
||||
await init();
|
||||
} catch(ex) {
|
||||
setTimeout(tryInit, 100);
|
||||
success = await init();
|
||||
} catch {
|
||||
}
|
||||
if ( success ) { return; }
|
||||
setTimeout(tryInit, 100);
|
||||
}
|
||||
|
||||
tryInit();
|
||||
|
@ -20,6 +20,8 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
EXCLUDED_INITIATOR_DOMAINS,
|
||||
INITIATOR_DOMAINS,
|
||||
TAB_ID_NONE,
|
||||
browser,
|
||||
dnr,
|
||||
@ -305,7 +307,7 @@ async function updateDynamicRules() {
|
||||
]);
|
||||
if ( addRules.length === 0 && removeRuleIds.length === 0 ) { return; }
|
||||
|
||||
const maxRegexRuleCount = dnr.MAX_NUMBER_OF_REGEX_RULES;
|
||||
const maxRegexRuleCount = dnr.MAX_NUMBER_OF_REGEX_RULES || 1000;
|
||||
let regexRuleCount = 0;
|
||||
let ruleId = 1;
|
||||
for ( const rule of addRules ) {
|
||||
@ -527,10 +529,10 @@ async function filteringModesToDNR(modes) {
|
||||
priority: 100,
|
||||
};
|
||||
if ( rule0.condition.requestDomains ) {
|
||||
rule1.condition.initiatorDomains =
|
||||
rule1.condition[INITIATOR_DOMAINS] =
|
||||
rule0.condition.requestDomains.slice();
|
||||
} else if ( rule0.condition.excludedRequestDomains ) {
|
||||
rule1.condition.excludedInitiatorDomains =
|
||||
rule1.condition[EXCLUDED_INITIATOR_DOMAINS] =
|
||||
rule0.condition.excludedRequestDomains.slice();
|
||||
}
|
||||
addSessionRules.push(rule1);
|
||||
@ -563,8 +565,8 @@ const isDifferentAllowRules = (a, b) => {
|
||||
const pp = [
|
||||
'requestDomains',
|
||||
'excludedRequestDomains',
|
||||
'initiatorDomains',
|
||||
'excludedInitiatorDomains',
|
||||
INITIATOR_DOMAINS,
|
||||
EXCLUDED_INITIATOR_DOMAINS,
|
||||
];
|
||||
for ( const p of pp ) {
|
||||
const ac = a?.length && a[0].condition[p] || [];
|
||||
|
@ -103,9 +103,12 @@ async function onFilteringModeChange(ev) {
|
||||
|
||||
switch ( newLevel ) {
|
||||
case 1: { // Revoke broad permissions
|
||||
await browser.permissions.remove({
|
||||
origins: [ '<all_urls>' ]
|
||||
});
|
||||
try {
|
||||
await browser.permissions.remove({ origins: [ '<all_urls>' ] });
|
||||
} catch(reason) {
|
||||
console.error(reason);
|
||||
await sendMessage({ what: 'setDefaultFilteringMode', level: 1 });
|
||||
}
|
||||
cachedRulesetData.defaultFilteringMode = 1;
|
||||
break;
|
||||
}
|
||||
@ -195,7 +198,7 @@ function getStagedTrustedSites() {
|
||||
return punycode.toASCII(
|
||||
(new URL(`https://${hn}/`)).hostname
|
||||
);
|
||||
} catch(_) {
|
||||
} catch {
|
||||
}
|
||||
return '';
|
||||
}).filter(hn => hn !== '');
|
||||
@ -292,7 +295,7 @@ sendMessage({
|
||||
renderFilterLists(cachedRulesetData);
|
||||
renderWidgets();
|
||||
dom.cl.remove(dom.body, 'loading');
|
||||
} catch(ex) {
|
||||
} catch {
|
||||
}
|
||||
listen();
|
||||
}).catch(reason => {
|
||||
|
25
platform/mv3/firefox/ext-compat.js
Normal file
25
platform/mv3/firefox/ext-compat.js
Normal file
@ -0,0 +1,25 @@
|
||||
/*******************************************************************************
|
||||
|
||||
uBlock Origin Lite - a comprehensive, MV3-compliant content blocker
|
||||
Copyright (C) 2022-present Raymond Hill
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||
|
||||
Home: https://github.com/gorhill/uBlock
|
||||
*/
|
||||
|
||||
export const webext = self.browser;
|
||||
|
||||
export const initiatorDomains = 'initiatorDomains';
|
||||
export const excludedInitiatorDomains = 'excludedInitiatorDomains';
|
@ -70,10 +70,6 @@ const env = [
|
||||
'user_stylesheet',
|
||||
];
|
||||
|
||||
if ( platform !== 'firefox' ) {
|
||||
env.push('native_css_has');
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
const jsonSetMapReplacer = (k, v) => {
|
||||
@ -125,7 +121,7 @@ const fetchText = (url, cacheDir) => {
|
||||
const content = data.join('');
|
||||
try {
|
||||
writeFile(`${cacheDir}/${fname}`, content);
|
||||
} catch (ex) {
|
||||
} catch {
|
||||
}
|
||||
resolve({ url, content });
|
||||
});
|
||||
@ -303,6 +299,38 @@ const isURLSkip = rule =>
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
function patchRuleset(ruleset) {
|
||||
if ( platform !== 'safari' ) { return ruleset; }
|
||||
const out = [];
|
||||
for ( const rule of ruleset ) {
|
||||
const condition = rule.condition;
|
||||
if ( rule.action.type === 'modifyHeaders' ) {
|
||||
log(`Safari's incomplete API: ${JSON.stringify(rule)}`, true);
|
||||
continue;
|
||||
}
|
||||
if ( Array.isArray(condition.requestMethods) ) {
|
||||
log(`Safari's incomplete API: ${JSON.stringify(rule)}`, true);
|
||||
continue;
|
||||
}
|
||||
if ( Array.isArray(condition.excludedRequestMethods) ) {
|
||||
log(`Safari's incomplete API: ${JSON.stringify(rule)}`, true);
|
||||
continue;
|
||||
}
|
||||
if ( Array.isArray(condition.initiatorDomains) ) {
|
||||
condition.domains = condition.initiatorDomains;
|
||||
delete condition.initiatorDomains;
|
||||
}
|
||||
if ( Array.isArray(condition.excludedInitiatorDomains) ) {
|
||||
condition.excludedDomains = condition.excludedInitiatorDomains;
|
||||
delete condition.excludedInitiatorDomains;
|
||||
}
|
||||
out.push(rule);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
// Two distinct hostnames:
|
||||
// www.example.com
|
||||
// example.com
|
||||
@ -473,7 +501,9 @@ async function processNetworkFilters(assetDetails, network) {
|
||||
}
|
||||
}
|
||||
|
||||
const plainGood = rules.filter(rule => isSafe(rule) && isRegex(rule) === false);
|
||||
const plainGood = patchRuleset(
|
||||
rules.filter(rule => isSafe(rule) && isRegex(rule) === false)
|
||||
);
|
||||
log(`\tPlain good: ${plainGood.length}`);
|
||||
log(plainGood
|
||||
.filter(rule => Array.isArray(rule._warning))
|
||||
@ -481,12 +511,16 @@ async function processNetworkFilters(assetDetails, network) {
|
||||
.join('\n'), true
|
||||
);
|
||||
|
||||
const regexes = rules.filter(rule => isSafe(rule) && isRegex(rule));
|
||||
const regexes = patchRuleset(
|
||||
rules.filter(rule => isSafe(rule) && isRegex(rule))
|
||||
);
|
||||
log(`\tMaybe good (regexes): ${regexes.length}`);
|
||||
|
||||
const redirects = rules.filter(rule =>
|
||||
const redirects = patchRuleset(
|
||||
rules.filter(rule =>
|
||||
isUnsupported(rule) === false &&
|
||||
isRedirect(rule)
|
||||
)
|
||||
);
|
||||
redirects.forEach(rule => {
|
||||
if ( rule.action.redirect.extensionPath === undefined ) { return; }
|
||||
@ -496,17 +530,23 @@ async function processNetworkFilters(assetDetails, network) {
|
||||
});
|
||||
log(`\tredirect=: ${redirects.length}`);
|
||||
|
||||
const removeparamsGood = rules.filter(rule =>
|
||||
const removeparamsGood = patchRuleset(
|
||||
rules.filter(rule =>
|
||||
isUnsupported(rule) === false && isRemoveparam(rule)
|
||||
)
|
||||
);
|
||||
const removeparamsBad = rules.filter(rule =>
|
||||
const removeparamsBad = patchRuleset(
|
||||
rules.filter(rule =>
|
||||
isUnsupported(rule) && isRemoveparam(rule)
|
||||
)
|
||||
);
|
||||
log(`\tremoveparams= (accepted/discarded): ${removeparamsGood.length}/${removeparamsBad.length}`);
|
||||
|
||||
const modifyHeaders = rules.filter(rule =>
|
||||
const modifyHeaders = patchRuleset(
|
||||
rules.filter(rule =>
|
||||
isUnsupported(rule) === false &&
|
||||
isModifyHeaders(rule)
|
||||
)
|
||||
);
|
||||
log(`\tmodifyHeaders=: ${modifyHeaders.length}`);
|
||||
|
||||
|
9
platform/mv3/safari/background.html
Normal file
9
platform/mv3/safari/background.html
Normal file
@ -0,0 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>uBO Lite</title>
|
||||
</head>
|
||||
<body>
|
||||
<script type="module" src="js/background.js"></script>
|
||||
</body>
|
||||
</html>
|
56
platform/mv3/safari/ext-compat.js
Normal file
56
platform/mv3/safari/ext-compat.js
Normal file
@ -0,0 +1,56 @@
|
||||
/*******************************************************************************
|
||||
|
||||
uBlock Origin Lite - a comprehensive, MV3-compliant content blocker
|
||||
Copyright (C) 2022-present Raymond Hill
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||
|
||||
Home: https://github.com/gorhill/uBlock
|
||||
*/
|
||||
|
||||
|
||||
export const webext = self.browser;
|
||||
|
||||
export const initiatorDomains = 'domains';
|
||||
export const excludedInitiatorDomains = 'excludedDomains';
|
||||
|
||||
const { declarativeNetRequest: dnr } = webext;
|
||||
const { getDynamicRules, getSessionRules } = dnr;
|
||||
|
||||
// https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/API/declarativeNetRequest/getDynamicRules
|
||||
dnr.getDynamicRules = function({ ruleIds } = {}) {
|
||||
return new Promise(resolve => {
|
||||
getDynamicRules.call(dnr, rules => {
|
||||
if ( Array.isArray(rules) === false ) { return resolve([]); }
|
||||
if ( Array.isArray(ruleIds) === false ) { return resolve(rules); }
|
||||
return resolve(rules.filter(rule => ruleIds.includes(rule.id)));
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/API/declarativeNetRequest/getSessionRules
|
||||
dnr.getSessionRules = function({ ruleIds } = {}) {
|
||||
return new Promise(resolve => {
|
||||
getSessionRules.call(dnr, rules => {
|
||||
if ( Array.isArray(rules) === false ) { return resolve([]); }
|
||||
if ( Array.isArray(ruleIds) === false ) { return resolve(rules); }
|
||||
return resolve(rules.filter(rule => ruleIds.includes(rule.id)));
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/API/declarativeNetRequest/getSessionRules
|
||||
webext.declarativeNetRequest.getAvailableStaticRuleCount = async function() {
|
||||
return 150000;
|
||||
};
|
50
platform/mv3/safari/manifest.json
Normal file
50
platform/mv3/safari/manifest.json
Normal file
@ -0,0 +1,50 @@
|
||||
{
|
||||
"action": {
|
||||
"default_icon": "/img/icon_64.png",
|
||||
"default_popup": "popup.html"
|
||||
},
|
||||
"author": "Raymond Hill",
|
||||
"background": {
|
||||
"scripts": [ "/js/background.js" ],
|
||||
"type": "module"
|
||||
},
|
||||
"declarative_net_request": {
|
||||
"rule_resources": [
|
||||
]
|
||||
},
|
||||
"default_locale": "en",
|
||||
"description": "__MSG_extShortDesc__",
|
||||
"icons": {
|
||||
"16": "/img/icon_16.png",
|
||||
"32": "/img/icon_32.png",
|
||||
"64": "/img/icon_64.png",
|
||||
"128": "/img/icon_128.png",
|
||||
"512": "/img/icon_512.png"
|
||||
},
|
||||
"manifest_version": 3,
|
||||
"name": "__MSG_extName__",
|
||||
"options_ui": {
|
||||
"page": "dashboard.html"
|
||||
},
|
||||
"host_permissions": [
|
||||
"<all_urls>"
|
||||
],
|
||||
"permissions": [
|
||||
"activeTab",
|
||||
"declarativeNetRequest",
|
||||
"scripting",
|
||||
"storage"
|
||||
],
|
||||
"short_name": "uBO Lite",
|
||||
"version": "1.0",
|
||||
"web_accessible_resources": [
|
||||
{
|
||||
"resources": [
|
||||
"/strictblock.html"
|
||||
],
|
||||
"matches": [
|
||||
"<all_urls>"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
343
platform/npm/package-lock.json
generated
343
platform/npm/package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@gorhill/ubo-core",
|
||||
"version": "0.1.26",
|
||||
"version": "0.1.30",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@gorhill/ubo-core",
|
||||
"version": "0.1.26",
|
||||
"version": "0.1.30",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"devDependencies": {
|
||||
"c8": "^7.12.0",
|
||||
@ -16,7 +16,7 @@
|
||||
"scaling-palm-tree": "github:mjethani/scaling-palm-tree#15cf1ab37e038771e1ff8005edc46d95f176739f"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0",
|
||||
"node": ">=18.0.0",
|
||||
"npm": ">=6.14.4"
|
||||
}
|
||||
},
|
||||
@ -192,10 +192,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/ansi-colors": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz",
|
||||
"integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==",
|
||||
"dev": true
|
||||
"version": "4.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz",
|
||||
"integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/ansi-regex": {
|
||||
"version": "5.0.1",
|
||||
@ -285,12 +289,6 @@
|
||||
"node": ">=10.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/c8/node_modules/yargs-parser": {
|
||||
"version": "20.2.9",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz",
|
||||
"integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/callsites": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
||||
@ -397,23 +395,28 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/cross-spawn": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
||||
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"path-key": "^3.1.0",
|
||||
"shebang-command": "^2.0.0",
|
||||
"which": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.3.4",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
|
||||
"integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
|
||||
"integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "2.1.2"
|
||||
"ms": "^2.1.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0"
|
||||
@ -437,10 +440,14 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/diff": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz",
|
||||
"integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==",
|
||||
"dev": true
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz",
|
||||
"integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"engines": {
|
||||
"node": ">=0.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/doctrine": {
|
||||
"version": "3.0.0",
|
||||
@ -1084,32 +1091,32 @@
|
||||
}
|
||||
},
|
||||
"node_modules/mocha": {
|
||||
"version": "10.2.0",
|
||||
"resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz",
|
||||
"integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==",
|
||||
"version": "10.8.2",
|
||||
"resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz",
|
||||
"integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-colors": "4.1.1",
|
||||
"browser-stdout": "1.3.1",
|
||||
"chokidar": "3.5.3",
|
||||
"debug": "4.3.4",
|
||||
"diff": "5.0.0",
|
||||
"escape-string-regexp": "4.0.0",
|
||||
"find-up": "5.0.0",
|
||||
"glob": "7.2.0",
|
||||
"he": "1.2.0",
|
||||
"js-yaml": "4.1.0",
|
||||
"log-symbols": "4.1.0",
|
||||
"minimatch": "5.0.1",
|
||||
"ms": "2.1.3",
|
||||
"nanoid": "3.3.3",
|
||||
"serialize-javascript": "6.0.0",
|
||||
"strip-json-comments": "3.1.1",
|
||||
"supports-color": "8.1.1",
|
||||
"workerpool": "6.2.1",
|
||||
"yargs": "16.2.0",
|
||||
"yargs-parser": "20.2.4",
|
||||
"yargs-unparser": "2.0.0"
|
||||
"ansi-colors": "^4.1.3",
|
||||
"browser-stdout": "^1.3.1",
|
||||
"chokidar": "^3.5.3",
|
||||
"debug": "^4.3.5",
|
||||
"diff": "^5.2.0",
|
||||
"escape-string-regexp": "^4.0.0",
|
||||
"find-up": "^5.0.0",
|
||||
"glob": "^8.1.0",
|
||||
"he": "^1.2.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
"log-symbols": "^4.1.0",
|
||||
"minimatch": "^5.1.6",
|
||||
"ms": "^2.1.3",
|
||||
"serialize-javascript": "^6.0.2",
|
||||
"strip-json-comments": "^3.1.1",
|
||||
"supports-color": "^8.1.1",
|
||||
"workerpool": "^6.5.1",
|
||||
"yargs": "^16.2.0",
|
||||
"yargs-parser": "^20.2.9",
|
||||
"yargs-unparser": "^2.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"_mocha": "bin/_mocha",
|
||||
@ -1117,10 +1124,6 @@
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 14.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/mochajs"
|
||||
}
|
||||
},
|
||||
"node_modules/mocha/node_modules/brace-expansion": {
|
||||
@ -1128,10 +1131,32 @@
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
||||
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/mocha/node_modules/glob": {
|
||||
"version": "8.1.0",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz",
|
||||
"integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==",
|
||||
"deprecated": "Glob versions prior to v9 are no longer supported",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^5.0.1",
|
||||
"once": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/mocha/node_modules/has-flag": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
||||
@ -1139,10 +1164,11 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/mocha/node_modules/minimatch": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz",
|
||||
"integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==",
|
||||
"version": "5.1.6",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
|
||||
"integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^2.0.1"
|
||||
},
|
||||
@ -1150,12 +1176,6 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/mocha/node_modules/ms": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/mocha/node_modules/supports-color": {
|
||||
"version": "8.1.1",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
|
||||
@ -1166,22 +1186,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/ms": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/nanoid": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz",
|
||||
"integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==",
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"nanoid": "bin/nanoid.cjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
|
||||
}
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/natural-compare": {
|
||||
"version": "1.4.0",
|
||||
@ -1312,6 +1321,7 @@
|
||||
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
|
||||
"integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safe-buffer": "^5.1.0"
|
||||
}
|
||||
@ -1392,7 +1402,22 @@
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
],
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/scaling-palm-tree": {
|
||||
"resolved": "git+ssh://git@github.com/mjethani/scaling-palm-tree.git#15cf1ab37e038771e1ff8005edc46d95f176739f",
|
||||
@ -1408,10 +1433,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/serialize-javascript": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz",
|
||||
"integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==",
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz",
|
||||
"integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"randombytes": "^2.1.0"
|
||||
}
|
||||
@ -1558,10 +1584,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/workerpool": {
|
||||
"version": "6.2.1",
|
||||
"resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz",
|
||||
"integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==",
|
||||
"dev": true
|
||||
"version": "6.5.1",
|
||||
"resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz",
|
||||
"integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
"node_modules/wrap-ansi": {
|
||||
"version": "7.0.0",
|
||||
@ -1626,10 +1653,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/yargs-parser": {
|
||||
"version": "20.2.4",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz",
|
||||
"integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==",
|
||||
"dev": true
|
||||
"version": "20.2.9",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz",
|
||||
"integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/yargs-unparser": {
|
||||
"version": "2.0.0",
|
||||
@ -1783,9 +1814,9 @@
|
||||
}
|
||||
},
|
||||
"ansi-colors": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz",
|
||||
"integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==",
|
||||
"version": "4.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz",
|
||||
"integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==",
|
||||
"dev": true
|
||||
},
|
||||
"ansi-regex": {
|
||||
@ -1865,14 +1896,6 @@
|
||||
"v8-to-istanbul": "^9.0.0",
|
||||
"yargs": "^16.2.0",
|
||||
"yargs-parser": "^20.2.9"
|
||||
},
|
||||
"dependencies": {
|
||||
"yargs-parser": {
|
||||
"version": "20.2.9",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz",
|
||||
"integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"callsites": {
|
||||
@ -1978,9 +2001,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"cross-spawn": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
||||
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"path-key": "^3.1.0",
|
||||
@ -1989,12 +2012,12 @@
|
||||
}
|
||||
},
|
||||
"debug": {
|
||||
"version": "4.3.4",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
|
||||
"integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
|
||||
"integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ms": "2.1.2"
|
||||
"ms": "^2.1.3"
|
||||
}
|
||||
},
|
||||
"decamelize": {
|
||||
@ -2010,9 +2033,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"diff": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz",
|
||||
"integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==",
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz",
|
||||
"integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==",
|
||||
"dev": true
|
||||
},
|
||||
"doctrine": {
|
||||
@ -2559,32 +2582,31 @@
|
||||
}
|
||||
},
|
||||
"mocha": {
|
||||
"version": "10.2.0",
|
||||
"resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz",
|
||||
"integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==",
|
||||
"version": "10.8.2",
|
||||
"resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz",
|
||||
"integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-colors": "4.1.1",
|
||||
"browser-stdout": "1.3.1",
|
||||
"chokidar": "3.5.3",
|
||||
"debug": "4.3.4",
|
||||
"diff": "5.0.0",
|
||||
"escape-string-regexp": "4.0.0",
|
||||
"find-up": "5.0.0",
|
||||
"glob": "7.2.0",
|
||||
"he": "1.2.0",
|
||||
"js-yaml": "4.1.0",
|
||||
"log-symbols": "4.1.0",
|
||||
"minimatch": "5.0.1",
|
||||
"ms": "2.1.3",
|
||||
"nanoid": "3.3.3",
|
||||
"serialize-javascript": "6.0.0",
|
||||
"strip-json-comments": "3.1.1",
|
||||
"supports-color": "8.1.1",
|
||||
"workerpool": "6.2.1",
|
||||
"yargs": "16.2.0",
|
||||
"yargs-parser": "20.2.4",
|
||||
"yargs-unparser": "2.0.0"
|
||||
"ansi-colors": "^4.1.3",
|
||||
"browser-stdout": "^1.3.1",
|
||||
"chokidar": "^3.5.3",
|
||||
"debug": "^4.3.5",
|
||||
"diff": "^5.2.0",
|
||||
"escape-string-regexp": "^4.0.0",
|
||||
"find-up": "^5.0.0",
|
||||
"glob": "^8.1.0",
|
||||
"he": "^1.2.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
"log-symbols": "^4.1.0",
|
||||
"minimatch": "^5.1.6",
|
||||
"ms": "^2.1.3",
|
||||
"serialize-javascript": "^6.0.2",
|
||||
"strip-json-comments": "^3.1.1",
|
||||
"supports-color": "^8.1.1",
|
||||
"workerpool": "^6.5.1",
|
||||
"yargs": "^16.2.0",
|
||||
"yargs-parser": "^20.2.9",
|
||||
"yargs-unparser": "^2.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"brace-expansion": {
|
||||
@ -2596,6 +2618,19 @@
|
||||
"balanced-match": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"glob": {
|
||||
"version": "8.1.0",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz",
|
||||
"integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^5.0.1",
|
||||
"once": "^1.3.0"
|
||||
}
|
||||
},
|
||||
"has-flag": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
||||
@ -2603,20 +2638,14 @@
|
||||
"dev": true
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz",
|
||||
"integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==",
|
||||
"version": "5.1.6",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
|
||||
"integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"brace-expansion": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"ms": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||
"dev": true
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "8.1.1",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
|
||||
@ -2629,15 +2658,9 @@
|
||||
}
|
||||
},
|
||||
"ms": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
|
||||
"dev": true
|
||||
},
|
||||
"nanoid": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz",
|
||||
"integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==",
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||
"dev": true
|
||||
},
|
||||
"natural-compare": {
|
||||
@ -2822,9 +2845,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"serialize-javascript": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz",
|
||||
"integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==",
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz",
|
||||
"integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"randombytes": "^2.1.0"
|
||||
@ -2954,9 +2977,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"workerpool": {
|
||||
"version": "6.2.1",
|
||||
"resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz",
|
||||
"integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==",
|
||||
"version": "6.5.1",
|
||||
"resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz",
|
||||
"integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==",
|
||||
"dev": true
|
||||
},
|
||||
"wrap-ansi": {
|
||||
@ -3024,9 +3047,9 @@
|
||||
}
|
||||
},
|
||||
"yargs-parser": {
|
||||
"version": "20.2.4",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz",
|
||||
"integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==",
|
||||
"version": "20.2.9",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz",
|
||||
"integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==",
|
||||
"dev": true
|
||||
},
|
||||
"yargs-unparser": {
|
||||
|
@ -23,6 +23,9 @@ for i in "$@"; do
|
||||
chromium)
|
||||
PLATFORM="chromium"
|
||||
;;
|
||||
safari)
|
||||
PLATFORM="safari"
|
||||
;;
|
||||
uBOLite_+([0-9]).+([0-9]).+([0-9]).+([0-9]))
|
||||
TAGNAME="$i"
|
||||
FULL="yes"
|
||||
@ -84,13 +87,13 @@ cp -R "$UBO_DIR/src/img/flags-of-the-world" "$DES"/img
|
||||
cp LICENSE.txt "$DES"/
|
||||
|
||||
echo "*** uBOLite.mv3: Copying mv3-specific files"
|
||||
if [ "$PLATFORM" = "firefox" ]; then
|
||||
cp platform/mv3/firefox/background.html "$DES"/
|
||||
fi
|
||||
cp platform/mv3/"$PLATFORM"/manifest.json "$DES"/
|
||||
cp platform/mv3/"$PLATFORM"/background.html "$DES"/ 2>/dev/null || :
|
||||
cp platform/mv3/extension/*.html "$DES"/
|
||||
cp platform/mv3/extension/*.json "$DES"/
|
||||
cp platform/mv3/extension/css/* "$DES"/css/
|
||||
cp -R platform/mv3/extension/js/* "$DES"/js/
|
||||
cp platform/mv3/"$PLATFORM"/ext-compat.js "$DES"/js/
|
||||
cp platform/mv3/extension/img/* "$DES"/img/
|
||||
cp -R platform/mv3/extension/_locales "$DES"/
|
||||
cp platform/mv3/README.md "$DES/"
|
||||
@ -99,11 +102,6 @@ if [ "$QUICK" != "yes" ]; then
|
||||
echo "*** uBOLite.mv3: Generating rulesets"
|
||||
TMPDIR=$(mktemp -d)
|
||||
mkdir -p "$TMPDIR"
|
||||
if [ "$PLATFORM" = "chromium" ]; then
|
||||
cp platform/mv3/chromium/manifest.json "$DES"/
|
||||
elif [ "$PLATFORM" = "firefox" ]; then
|
||||
cp platform/mv3/firefox/manifest.json "$DES"/
|
||||
fi
|
||||
./tools/make-nodejs.sh "$TMPDIR"
|
||||
cp platform/mv3/package.json "$TMPDIR"/
|
||||
cp platform/mv3/*.js "$TMPDIR"/
|
||||
|
Loading…
x
Reference in New Issue
Block a user