Skip to content

Commit a176556

Browse files
authored
Merge pull request gorhill#41 from gorhill/master
Re-sync with uBo master
2 parents e52f38a + 5e6600a commit a176556

57 files changed

Lines changed: 3051 additions & 522 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/main.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
tools/make-chromium.sh ${{ steps.release_info.outputs.VERSION }}
4040
tools/make-firefox.sh ${{ steps.release_info.outputs.VERSION }}
4141
tools/make-thunderbird.sh ${{ steps.release_info.outputs.VERSION }}
42-
tools/make-nodejs.sh ${{ steps.release_info.outputs.VERSION }}
42+
tools/make-npm.sh ${{ steps.release_info.outputs.VERSION }}
4343
- name: Upload Chromium package
4444
uses: actions/upload-release-asset@v1
4545
env:
@@ -73,6 +73,6 @@ jobs:
7373
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7474
with:
7575
upload_url: ${{ steps.create_release.outputs.upload_url }}
76-
asset_path: dist/build/uBlock0_${{ steps.release_info.outputs.VERSION }}.nodejs.zip
77-
asset_name: uBlock0_${{ steps.release_info.outputs.VERSION }}.nodejs.zip
76+
asset_path: dist/build/uBlock0_${{ steps.release_info.outputs.VERSION }}.npm.tgz
77+
asset_name: uBlock0_${{ steps.release_info.outputs.VERSION }}.npm.tgz
7878
asset_content_type: application/octet-stream

‎.jshintrc‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
"self": false,
1212
"vAPI": false,
1313
"webext": false,
14-
"µBlock": false
14+
"µBlock": false,
15+
"URLSearchParams": false,
16+
"WebAssembly": false
1517
},
1618
"laxbreak": true,
1719
"newcap": false,

‎Makefile‎

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
.PHONY: all clean lint chromium firefox nodejs
1+
# https://stackoverflow.com/a/6273809
2+
run_options := $(filter-out $@,$(MAKECMDGOALS))
3+
4+
.PHONY: all clean test lint chromium firefox npm dig \
5+
compare maxcost mincost modifiers record wasm
26

37
sources := $(wildcard src/* src/*/* src/*/*/* src/*/*/*/*)
48
platform := $(wildcard platform/* platform/*/*)
@@ -7,7 +11,7 @@ assets := $(wildcard submodules/uAssets/* \
711
submodules/uAssets/*/*/* \
812
submodules/uAssets/*/*/*/*)
913

10-
all: chromium firefox nodejs
14+
all: chromium firefox npm
1115

1216
dist/build/uBlock0.chromium: tools/make-chromium.sh $(sources) $(platform) $(assets)
1317
tools/make-chromium.sh
@@ -21,20 +25,51 @@ dist/build/uBlock0.firefox: tools/make-firefox.sh $(sources) $(platform) $(asset
2125
# Build the extension for Firefox.
2226
firefox: dist/build/uBlock0.firefox
2327

24-
dist/build/uBlock0.nodejs: tools/make-nodejs.sh $(sources) $(platform) $(assets)
25-
tools/make-nodejs.sh
28+
dist/build/uBlock0.npm: tools/make-nodejs.sh $(sources) $(platform) $(assets)
29+
tools/make-npm.sh
2630

2731
# Build the Node.js package.
28-
nodejs: dist/build/uBlock0.nodejs
32+
npm: dist/build/uBlock0.npm
33+
34+
lint: npm
35+
cd dist/build/uBlock0.npm && npm run lint
36+
37+
test: npm
38+
cd dist/build/uBlock0.npm && npm run test
39+
40+
test-full-battery: npm
41+
cd dist/build/uBlock0.npm && npm run test-full-battery
42+
43+
check-leaks: npm
44+
cd dist/build/uBlock0.npm && npm run check-leaks
2945

30-
lint: nodejs
31-
eslint -c platform/nodejs/eslintrc.json \
32-
dist/build/uBlock0.nodejs/js \
33-
dist/build/uBlock0.nodejs/*.js
46+
dist/build/uBlock0.dig: tools/make-nodejs.sh $(sources) $(platform) $(assets)
47+
tools/make-dig.sh
48+
49+
dig: dist/build/uBlock0.dig
50+
cd dist/build/uBlock0.dig && npm install
51+
52+
dig-snfe: dig
53+
cd dist/build/uBlock0.dig && npm run snfe $(run_options)
3454

3555
# Update submodules.
3656
update-submodules:
3757
tools/update-submodules.sh
3858

3959
clean:
40-
rm -rf dist/build
60+
rm -rf dist/build tmp/node_modules
61+
62+
63+
# Not real targets, just convenient for auto-completion at shell prompt
64+
compare:
65+
@echo
66+
maxcost:
67+
@echo
68+
mincost:
69+
@echo
70+
modifiers:
71+
@echo
72+
record:
73+
@echo
74+
wasm:
75+
@echo

‎dist/firefox/updates.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"uBlock0@raymondhill.net": {
44
"updates": [
55
{
6-
"version": "1.37.3.8",
6+
"version": "1.37.3.16",
77
"browser_specific_settings": { "gecko": { "strict_min_version": "57" } },
8-
"update_link": "https://github.com/gorhill/uBlock/releases/download/1.37.3b8/uBlock0_1.37.3b8.firefox.signed.xpi"
8+
"update_link": "https://github.com/gorhill/uBlock/releases/download/1.37.3b16/uBlock0_1.37.3b16.firefox.signed.xpi"
99
}
1010
]
1111
}

‎dist/version‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.37.3.8
1+
1.37.3.16

‎platform/browser/main.js‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323

2424
/******************************************************************************/
2525

26-
import './lib/publicsuffixlist/publicsuffixlist.js';
27-
import './lib/punycode.js';
26+
import publicSuffixList from './lib/publicsuffixlist/publicsuffixlist.js';
27+
import punycode from './lib/punycode.js';
2828

29-
import globals from './js/globals.js';
3029
import staticNetFilteringEngine from './js/static-net-filtering.js';
3130
import { FilteringContext } from './js/filtering-context.js';
3231
import { LineIterator } from './js/text-utils.js';
@@ -83,7 +82,7 @@ function applyList(name, raw) {
8382

8483
function enableWASM(path) {
8584
return Promise.all([
86-
globals.publicSuffixList.enableWASM(`${path}/lib/publicsuffixlist`),
85+
publicSuffixList.enableWASM(`${path}/lib/publicsuffixlist`),
8786
staticNetFilteringEngine.enableWASM(`${path}/js`),
8887
]);
8988
}
@@ -93,7 +92,7 @@ function pslInit(raw) {
9392
console.info('Unable to populate public suffix list');
9493
return;
9594
}
96-
globals.publicSuffixList.parse(raw, globals.punycode.toASCII);
95+
publicSuffixList.parse(raw, punycode.toASCII);
9796
console.info('Public suffix list populated');
9897
}
9998

Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
{
2-
"name": "@gorhill/ubo-core",
3-
"version": "0.1.8",
4-
"description": "To create a working instance of uBlock Origin's static network filtering engine",
2+
"name": "@gorhill/ubo-dig",
3+
"version": "0.1.0",
4+
"description": "To investigate code changes (not for publication)",
55
"type": "module",
66
"main": "index.js",
77
"scripts": {
88
"build": "node build.js",
9-
"test": "node test.js"
9+
"snfe": "node snfe.js"
1010
},
1111
"repository": {
1212
"type": "git",
1313
"url": "git+https://github.com/gorhill/uBlock.git"
1414
},
15-
"keywords": [
16-
"uBlock",
17-
"uBO",
18-
"adblock",
19-
"trie"
20-
],
2115
"author": "Raymond Hill",
2216
"license": "GPL-3.0-or-later",
2317
"bugs": {
@@ -27,5 +21,8 @@
2721
"engines": {
2822
"node": ">=14.0.0",
2923
"npm": ">=6.14.4"
24+
},
25+
"devDependencies": {
26+
"scaling-palm-tree": "github:mjethani/scaling-palm-tree#15cf1ab"
3027
}
3128
}

0 commit comments

Comments
 (0)