-
Notifications
You must be signed in to change notification settings - Fork 1
/
generate-engine.js
114 lines (108 loc) · 3.68 KB
/
generate-engine.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
// Generating an ad and tracking engine with filters
const { writeFileSync } = require('fs');
const fetch = require('node-fetch');
const { FiltersEngine } = require('@cliqz/adblocker');
const {
WebExtensionBlocker,
fullLists,
} = require('@cliqz/adblocker-webextension');
(async () => {
console.log('Generate pre-built adblocker engine...');
writeFileSync(
'engine.bin',
(
await WebExtensionBlocker.fromLists(fetch, fullLists, {
debug: false,
enableCompression: true,
enableHtmlFiltering: true,
enableMutationObserver: true,
enableOptimizations: true,
guessRequestTypeFromUrl: false,
integrityCheck: true,
loadCosmeticFilters: true,
loadExtendedSelectors: true,
loadGenericCosmeticsFilters: true,
loadNetworkFilters: true,
}
)
).serialize(),
(
await WebExtensionBlocker.fromLists(fetch, [
'https://secure.fanboy.co.nz/fanboy-cookiemonster.txt'
])
).serialize(),
(
await WebExtensionBlocker.fromLists(fetch, [
'https://raw.githubusercontent.com/AdguardTeam/AdguardFilters/master/SpywareFilter/sections/tracking_servers.txt'
])
).serialize(),
(
await WebExtensionBlocker.fromPrebuiltAdsAndTracking(fetch)
).serialize(),
(
await WebExtensionBlocker.fromLists(fetch, [
'https://raw.githubusercontent.com/AdguardTeam/FiltersRegistry/master/filters/filter_2_English/filter.txt'
])
).serialize(),
(
await WebExtensionBlocker.fromLists(fetch, [
'https://raw.githubusercontent.com/AdguardTeam/FiltersRegistry/master/filters/filter_15_DnsFilter/filter.txt'
])
).serialize(),
(
await WebExtensionBlocker.fromLists(fetch, [
'https://raw.githubusercontent.com/AdguardTeam/FiltersRegistry/master/filters/filter_11_Mobile/filter.txt'
])
).serialize(),
(
await WebExtensionBlocker.fromLists(fetch, [
'https://raw.githubusercontent.com/AdguardTeam/FiltersRegistry/master/filters/filter_15_DnsFilter/filter.txt'
])
).serialize(),
(
await WebExtensionBlocker.fromLists(fetch, [
'https://curben.gitlab.io/malware-filter/urlhaus-filter-ag.txt'
])
).serialize(),
(
await WebExtensionBlocker.fromLists(fetch, [
' https://raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/master/nocoin.txt'
])
).serialize(),
(
await WebExtensionBlocker.fromLists(fetch, [
'https://raw.githubusercontent.com/uBlock-user/uBO-Personal-Filters/master/uPF.txt'
])
).serialize(),
(
await WebExtensionBlocker.fromLists(fetch, [
'https://easylist-downloads.adblockplus.org/antiadblockfilters.txt'
])
).serialize(),
(
await WebExtensionBlocker.fromLists(fetch, [
'https://raw.githubusercontent.com/bogachenko/fuckfuckadblock/master/fuckfuckadblock.txt'
])
).serialize(),
(
await WebExtensionBlocker.fromLists(fetch, [
'https://gitcdn.xyz/cdn/NanoAdblocker/NanoFilters/5e63d1a37cdb3e277f8db30e87df56e816c454c9/NanoMirror/NanoDefender.txt'
])
).serialize(),
(
await WebExtensionBlocker.fromLists(fetch, [
'https://gitcdn.xyz/cdn/NanoAdblocker/NanoFilters/5e63d1a37cdb3e277f8db30e87df56e816c454c9/NanoFilters/NanoBase.txt'
])
).serialize(),
(
await WebExtensionBlocker.fromLists(fetch, [
'https://pgl.yoyo.org/adservers/serverlist.php?hostformat=adblockplus&showintro=1'
])
).serialize(),
(
await WebExtensionBlocker.fromLists(fetch, [
'https://gitlab.com/curben/urlhaus-filter/raw/master/urlhaus-filter-online.txt'
])
).serialize(),
);
})();