@browserless.io/browserless 2.0.0-beta-5 → 2.0.0-beta-7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +2 -0
- package/README.md +11 -11
- package/bin/browserless.js +169 -11
- package/bin/scaffold/README.md +415 -0
- package/bin/scaffold/package.json +21 -0
- package/bin/scaffold/src/hello-world.http.ts +27 -0
- package/bin/scaffold/tsconfig.json +4 -0
- package/build/browserless.js +18 -15
- package/build/browsers/index.d.ts +2 -18
- package/build/browsers/index.js +43 -14
- package/build/file-system.d.ts +5 -0
- package/build/file-system.js +20 -5
- package/build/file-system.spec.d.ts +1 -0
- package/build/file-system.spec.js +44 -0
- package/build/http.d.ts +3 -3
- package/build/http.js +3 -3
- package/build/router.js +2 -4
- package/build/routes/chromium/http/content-post.body.json +8 -8
- package/build/routes/chromium/http/content-post.d.ts +15 -3
- package/build/routes/chromium/http/content-post.js +14 -15
- package/build/routes/chromium/http/download-post.d.ts +16 -3
- package/build/routes/chromium/http/download-post.js +17 -22
- package/build/routes/chromium/http/function-post.d.ts +16 -3
- package/build/routes/chromium/http/function-post.js +17 -22
- package/build/routes/chromium/http/pdf-post.body.json +8 -8
- package/build/routes/chromium/http/pdf-post.d.ts +15 -3
- package/build/routes/chromium/http/pdf-post.js +19 -15
- package/build/routes/chromium/http/performance.d.ts +15 -3
- package/build/routes/chromium/http/performance.js +15 -23
- package/build/routes/chromium/http/scrape-post.body.json +8 -8
- package/build/routes/chromium/http/scrape-post.d.ts +15 -3
- package/build/routes/chromium/http/scrape-post.js +15 -16
- package/build/routes/chromium/http/screenshot-post.body.json +8 -8
- package/build/routes/chromium/http/screenshot-post.d.ts +15 -3
- package/build/routes/chromium/http/screenshot-post.js +18 -15
- package/build/routes/chromium/tests/websocket.spec.js +20 -1
- package/build/routes/chromium/utils/function/handler.js +2 -2
- package/build/routes/chromium/ws/browser.d.ts +13 -3
- package/build/routes/chromium/ws/browser.js +10 -11
- package/build/routes/chromium/ws/cdp-chromium.d.ts +13 -3
- package/build/routes/chromium/ws/cdp-chromium.js +10 -11
- package/build/routes/chromium/ws/page.d.ts +13 -3
- package/build/routes/chromium/ws/page.js +10 -11
- package/build/routes/chromium/ws/playwright-chromium.d.ts +13 -3
- package/build/routes/chromium/ws/playwright-chromium.js +11 -12
- package/build/routes/firefox/ws/playwright-firefox.d.ts +13 -3
- package/build/routes/firefox/ws/playwright-firefox.js +11 -12
- package/build/routes/management/http/config-get.d.ts +15 -3
- package/build/routes/management/http/config-get.js +15 -20
- package/build/routes/management/http/metrics-get.d.ts +15 -3
- package/build/routes/management/http/metrics-get.js +16 -21
- package/build/routes/management/http/metrics-total-get.d.ts +15 -3
- package/build/routes/management/http/metrics-total-get.js +16 -21
- package/build/routes/management/http/sessions-get.d.ts +15 -3
- package/build/routes/management/http/sessions-get.js +16 -20
- package/build/routes/management/http/static-get.d.ts +15 -3
- package/build/routes/management/http/static-get.js +15 -20
- package/build/routes/webkit/ws/playwright-webkit.d.ts +13 -3
- package/build/routes/webkit/ws/playwright-webkit.js +11 -12
- package/build/server.js +0 -1
- package/build/types.d.ts +48 -38
- package/build/types.js +135 -0
- package/extensions/ublock/1p-filters.html +0 -1
- package/extensions/ublock/3p-filters.html +0 -2
- package/extensions/ublock/_locales/bg/messages.json +6 -6
- package/extensions/ublock/_locales/br_FR/messages.json +14 -14
- package/extensions/ublock/_locales/bs/messages.json +8 -8
- package/extensions/ublock/_locales/ca/messages.json +1 -1
- package/extensions/ublock/_locales/da/messages.json +5 -5
- package/extensions/ublock/_locales/fa/messages.json +1 -1
- package/extensions/ublock/_locales/fi/messages.json +6 -6
- package/extensions/ublock/_locales/hr/messages.json +4 -4
- package/extensions/ublock/_locales/nb/messages.json +1 -1
- package/extensions/ublock/_locales/no/messages.json +1 -1
- package/extensions/ublock/_locales/ro/messages.json +2 -2
- package/extensions/ublock/_locales/ru/messages.json +1 -1
- package/extensions/ublock/_locales/sk/messages.json +1 -1
- package/extensions/ublock/_locales/sv/messages.json +2 -2
- package/extensions/ublock/_locales/te/messages.json +17 -17
- package/extensions/ublock/_locales/vi/messages.json +12 -12
- package/extensions/ublock/_locales/zh_TW/messages.json +13 -13
- package/extensions/ublock/assets/assets.json +3 -3
- package/extensions/ublock/assets/resources/scriptlets.js +218 -97
- package/extensions/ublock/assets/thirdparties/easylist/easylist.txt +3010 -2056
- package/extensions/ublock/assets/thirdparties/easylist/easyprivacy.txt +624 -433
- package/extensions/ublock/assets/thirdparties/pgl.yoyo.org/as/serverlist +93 -24
- package/extensions/ublock/assets/thirdparties/publicsuffix.org/list/effective_tld_names.dat +7 -15
- package/extensions/ublock/assets/thirdparties/urlhaus-filter/urlhaus-filter-online.txt +795 -777
- package/extensions/ublock/assets/ublock/badware.min.txt +138 -72
- package/extensions/ublock/assets/ublock/filters.min.txt +1929 -2735
- package/extensions/ublock/assets/ublock/privacy.min.txt +57 -26
- package/extensions/ublock/assets/ublock/quick-fixes.min.txt +125 -74
- package/extensions/ublock/assets/ublock/unbreak.min.txt +46 -53
- package/extensions/ublock/css/codemirror.css +8 -7
- package/extensions/ublock/css/dom-inspector.css +40 -0
- package/extensions/ublock/css/logger-ui-inspector.css +7 -1
- package/extensions/ublock/css/logger-ui.css +12 -5
- package/extensions/ublock/css/popup-fenix.css +1 -1
- package/extensions/ublock/devtools.html +1 -0
- package/extensions/ublock/js/1p-filters.js +4 -3
- package/extensions/ublock/js/3p-filters.js +25 -31
- package/extensions/ublock/js/about.js +1 -1
- package/extensions/ublock/js/advanced-settings.js +1 -1
- package/extensions/ublock/js/asset-viewer.js +1 -1
- package/extensions/ublock/js/assets.js +74 -44
- package/extensions/ublock/js/background.js +9 -3
- package/extensions/ublock/js/base64-custom.js +1 -1
- package/extensions/ublock/js/benchmarks.js +1 -1
- package/extensions/ublock/js/biditrie.js +1 -1
- package/extensions/ublock/js/broadcast.js +75 -0
- package/extensions/ublock/js/cachestorage.js +68 -45
- package/extensions/ublock/js/click2load.js +1 -1
- package/extensions/ublock/js/cloud-ui.js +1 -1
- package/extensions/ublock/js/code-viewer.js +1 -1
- package/extensions/ublock/js/codemirror/search-thread.js +1 -1
- package/extensions/ublock/js/codemirror/search.js +1 -1
- package/extensions/ublock/js/codemirror/ubo-dynamic-filtering.js +1 -1
- package/extensions/ublock/js/codemirror/ubo-static-filtering.js +98 -24
- package/extensions/ublock/js/commands.js +1 -1
- package/extensions/ublock/js/console.js +1 -1
- package/extensions/ublock/js/contentscript-extra.js +1 -1
- package/extensions/ublock/js/contentscript.js +1 -3
- package/extensions/ublock/js/contextmenu.js +1 -1
- package/extensions/ublock/js/cosmetic-filtering.js +4 -4
- package/extensions/ublock/js/dashboard-common.js +1 -1
- package/extensions/ublock/js/dashboard.js +1 -1
- package/extensions/ublock/js/devtools.js +23 -15
- package/extensions/ublock/js/diff-updater.js +3 -3
- package/extensions/ublock/js/document-blocked.js +1 -1
- package/extensions/ublock/js/dom-inspector.js +68 -0
- package/extensions/ublock/js/dom.js +1 -1
- package/extensions/ublock/js/dyna-rules.js +1 -1
- package/extensions/ublock/js/dynamic-net-filtering.js +1 -1
- package/extensions/ublock/js/epicker-ui.js +35 -59
- package/extensions/ublock/js/fa-icons.js +1 -1
- package/extensions/ublock/js/filtering-context.js +1 -1
- package/extensions/ublock/js/filtering-engines.js +1 -1
- package/extensions/ublock/js/hnswitches.js +1 -1
- package/extensions/ublock/js/hntrie.js +1 -1
- package/extensions/ublock/js/html-filtering.js +1 -1
- package/extensions/ublock/js/httpheader-filtering.js +1 -1
- package/extensions/ublock/js/i18n.js +1 -1
- package/extensions/ublock/js/is-webrtc-supported.js +1 -1
- package/extensions/ublock/js/logger-ui-inspector.js +203 -145
- package/extensions/ublock/js/logger-ui.js +21 -5
- package/extensions/ublock/js/logger.js +6 -2
- package/extensions/ublock/js/lz4.js +2 -2
- package/extensions/ublock/js/messaging.js +266 -166
- package/extensions/ublock/js/mrucache.js +58 -0
- package/extensions/ublock/js/pagestore.js +1 -1
- package/extensions/ublock/js/popup-fenix.js +2 -1
- package/extensions/ublock/js/redirect-engine.js +1 -1
- package/extensions/ublock/js/redirect-resources.js +1 -12
- package/extensions/ublock/js/reverselookup-worker.js +1 -1
- package/extensions/ublock/js/reverselookup.js +1 -1
- package/extensions/ublock/js/scriptlet-filtering-core.js +300 -0
- package/extensions/ublock/js/scriptlet-filtering.js +122 -350
- package/extensions/ublock/js/scriptlets/cosmetic-logger.js +36 -47
- package/extensions/ublock/js/scriptlets/cosmetic-off.js +1 -1
- package/extensions/ublock/js/scriptlets/cosmetic-on.js +1 -1
- package/extensions/ublock/js/scriptlets/cosmetic-report.js +1 -1
- package/extensions/ublock/js/scriptlets/dom-inspector.js +341 -323
- package/extensions/ublock/js/scriptlets/dom-survey-elements.js +1 -1
- package/extensions/ublock/js/scriptlets/dom-survey-scripts.js +1 -1
- package/extensions/ublock/js/scriptlets/epicker.js +80 -89
- package/extensions/ublock/js/scriptlets/load-3p-css.js +1 -1
- package/extensions/ublock/js/scriptlets/load-large-media-all.js +1 -1
- package/extensions/ublock/js/scriptlets/load-large-media-interactive.js +1 -1
- package/extensions/ublock/js/scriptlets/noscript-spoof.js +1 -1
- package/extensions/ublock/js/scriptlets/should-inject-contentscript.js +1 -1
- package/extensions/ublock/js/scriptlets/subscriber.js +1 -1
- package/extensions/ublock/js/scriptlets/updater.js +20 -3
- package/extensions/ublock/js/settings.js +1 -1
- package/extensions/ublock/js/start.js +19 -20
- package/extensions/ublock/js/static-dnr-filtering.js +1 -1
- package/extensions/ublock/js/static-ext-filtering-db.js +1 -1
- package/extensions/ublock/js/static-ext-filtering.js +1 -1
- package/extensions/ublock/js/static-filtering-io.js +1 -1
- package/extensions/ublock/js/static-filtering-parser.js +5 -3
- package/extensions/ublock/js/static-net-filtering.js +57 -37
- package/extensions/ublock/js/storage.js +49 -29
- package/extensions/ublock/js/support.js +4 -4
- package/extensions/ublock/js/tab.js +1 -1
- package/extensions/ublock/js/tasks.js +1 -1
- package/extensions/ublock/js/text-encode.js +1 -1
- package/extensions/ublock/js/text-utils.js +1 -1
- package/extensions/ublock/js/theme.js +1 -1
- package/extensions/ublock/js/traffic.js +2 -1
- package/extensions/ublock/js/ublock.js +15 -11
- package/extensions/ublock/js/uri-utils.js +1 -1
- package/extensions/ublock/js/url-net-filtering.js +1 -1
- package/extensions/ublock/js/utils.js +1 -73
- package/extensions/ublock/js/vapi-background-ext.js +1 -1
- package/extensions/ublock/js/vapi-background.js +92 -83
- package/extensions/ublock/js/vapi-client.js +4 -33
- package/extensions/ublock/js/vapi-common.js +16 -30
- package/extensions/ublock/js/vapi.js +1 -1
- package/extensions/ublock/js/wasm/biditrie.wat +1 -1
- package/extensions/ublock/js/wasm/hntrie.wat +1 -1
- package/extensions/ublock/js/webext.js +1 -1
- package/extensions/ublock/js/whitelist.js +1 -1
- package/extensions/ublock/logger-ui.html +2 -2
- package/extensions/ublock/manifest.json +1 -1
- package/extensions/ublock/support.html +0 -1
- package/extensions/ublock/web_accessible_resources/dom-inspector.html +25 -0
- package/extensions/ublock/web_accessible_resources/epicker-ui.html +0 -1
- package/extensions/ublock/web_accessible_resources/googletagservices_gpt.js +1 -0
- package/package.json +7 -19
- package/scripts/build-open-api.js +7 -4
- package/src/browserless.ts +42 -18
- package/src/browsers/index.ts +48 -20
- package/src/file-system.spec.ts +58 -0
- package/src/file-system.ts +36 -8
- package/src/http.ts +3 -3
- package/src/router.ts +2 -6
- package/src/routes/chromium/http/content-post.ts +13 -16
- package/src/routes/chromium/http/download-post.ts +16 -27
- package/src/routes/chromium/http/function-post.ts +16 -25
- package/src/routes/chromium/http/pdf-post.ts +19 -15
- package/src/routes/chromium/http/performance.ts +14 -26
- package/src/routes/chromium/http/scrape-post.ts +14 -16
- package/src/routes/chromium/http/screenshot-post.ts +18 -15
- package/src/routes/chromium/tests/websocket.spec.ts +28 -1
- package/src/routes/chromium/utils/function/handler.ts +2 -1
- package/src/routes/chromium/ws/browser.ts +10 -12
- package/src/routes/chromium/ws/cdp-chromium.ts +10 -12
- package/src/routes/chromium/ws/page.ts +10 -12
- package/src/routes/chromium/ws/playwright-chromium.ts +10 -12
- package/src/routes/firefox/ws/playwright-firefox.ts +10 -12
- package/src/routes/management/http/config-get.ts +14 -23
- package/src/routes/management/http/metrics-get.ts +15 -24
- package/src/routes/management/http/metrics-total-get.ts +15 -26
- package/src/routes/management/http/sessions-get.ts +15 -23
- package/src/routes/management/http/static-get.ts +14 -22
- package/src/routes/webkit/ws/playwright-webkit.ts +10 -12
- package/src/server.ts +0 -1
- package/src/types.ts +59 -45
- package/static/docs/browserless-logo-inline.svg +1 -0
- package/static/docs/index.html +27 -0
- package/static/docs/swagger.json +33 -33
- package/static/function/client.js +626 -78
- package/extensions/ublock/js/vapi-client-extra.js +0 -312
- package/extensions/ublock/web_accessible_resources/addthis_widget.js +0 -39
- package/extensions/ublock/web_accessible_resources/ligatus_angular-tag.js +0 -29
- package/extensions/ublock/web_accessible_resources/monkeybroker.js +0 -43
- package/extensions/ublock/web_accessible_resources/mxpnl_mixpanel.js +0 -51
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
/*******************************************************************************
|
|
2
|
-
|
|
3
|
-
uBlock Origin - a browser extension to block requests.
|
|
4
|
-
Copyright (C) 2019-present Raymond Hill
|
|
5
|
-
|
|
6
|
-
This program is free software: you can redistribute it and/or modify
|
|
7
|
-
it under the terms of the GNU General Public License as published by
|
|
8
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
(at your option) any later version.
|
|
10
|
-
|
|
11
|
-
This program is distributed in the hope that it will be useful,
|
|
12
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
GNU General Public License for more details.
|
|
15
|
-
|
|
16
|
-
You should have received a copy of the GNU General Public License
|
|
17
|
-
along with this program. If not, see {http://www.gnu.org/licenses/}.
|
|
18
|
-
|
|
19
|
-
Home: https://github.com/gorhill/uBlock
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
// For non-background page
|
|
23
|
-
|
|
24
|
-
'use strict';
|
|
25
|
-
|
|
26
|
-
/******************************************************************************/
|
|
27
|
-
|
|
28
|
-
// Direct messaging connection ability
|
|
29
|
-
|
|
30
|
-
(( ) => {
|
|
31
|
-
// >>>>>>>> start of private namespace
|
|
32
|
-
|
|
33
|
-
if (
|
|
34
|
-
typeof vAPI !== 'object' ||
|
|
35
|
-
vAPI.messaging instanceof Object === false ||
|
|
36
|
-
vAPI.MessagingConnection instanceof Function
|
|
37
|
-
) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const listeners = new Set();
|
|
42
|
-
const connections = new Map();
|
|
43
|
-
|
|
44
|
-
vAPI.MessagingConnection = class {
|
|
45
|
-
constructor(handler, details) {
|
|
46
|
-
this.messaging = vAPI.messaging;
|
|
47
|
-
this.handler = handler;
|
|
48
|
-
this.id = details.id;
|
|
49
|
-
this.to = details.to;
|
|
50
|
-
this.toToken = details.toToken;
|
|
51
|
-
this.from = details.from;
|
|
52
|
-
this.fromToken = details.fromToken;
|
|
53
|
-
this.checkTimer = undefined;
|
|
54
|
-
// On Firefox it appears ports are not automatically disconnected
|
|
55
|
-
// when navigating to another page.
|
|
56
|
-
const ctor = vAPI.MessagingConnection;
|
|
57
|
-
if ( ctor.pagehide !== undefined ) { return; }
|
|
58
|
-
ctor.pagehide = ( ) => {
|
|
59
|
-
for ( const connection of connections.values() ) {
|
|
60
|
-
connection.disconnect();
|
|
61
|
-
connection.handler(
|
|
62
|
-
connection.toDetails('connectionBroken')
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
window.addEventListener('pagehide', ctor.pagehide);
|
|
67
|
-
}
|
|
68
|
-
toDetails(what, payload) {
|
|
69
|
-
return {
|
|
70
|
-
what: what,
|
|
71
|
-
id: this.id,
|
|
72
|
-
from: this.from,
|
|
73
|
-
fromToken: this.fromToken,
|
|
74
|
-
to: this.to,
|
|
75
|
-
toToken: this.toToken,
|
|
76
|
-
payload: payload
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
disconnect() {
|
|
80
|
-
if ( this.checkTimer !== undefined ) {
|
|
81
|
-
clearTimeout(this.checkTimer);
|
|
82
|
-
this.checkTimer = undefined;
|
|
83
|
-
}
|
|
84
|
-
connections.delete(this.id);
|
|
85
|
-
const port = this.messaging.getPort();
|
|
86
|
-
if ( port === null ) { return; }
|
|
87
|
-
port.postMessage({
|
|
88
|
-
channel: 'vapi',
|
|
89
|
-
msg: this.toDetails('connectionBroken'),
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
checkAsync() {
|
|
93
|
-
if ( this.checkTimer !== undefined ) {
|
|
94
|
-
clearTimeout(this.checkTimer);
|
|
95
|
-
}
|
|
96
|
-
this.checkTimer = vAPI.setTimeout(
|
|
97
|
-
( ) => { this.check(); },
|
|
98
|
-
499
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
check() {
|
|
102
|
-
this.checkTimer = undefined;
|
|
103
|
-
if ( connections.has(this.id) === false ) { return; }
|
|
104
|
-
const port = this.messaging.getPort();
|
|
105
|
-
if ( port === null ) { return; }
|
|
106
|
-
port.postMessage({
|
|
107
|
-
channel: 'vapi',
|
|
108
|
-
msg: this.toDetails('connectionCheck'),
|
|
109
|
-
});
|
|
110
|
-
this.checkAsync();
|
|
111
|
-
}
|
|
112
|
-
receive(details) {
|
|
113
|
-
switch ( details.what ) {
|
|
114
|
-
case 'connectionAccepted':
|
|
115
|
-
this.toToken = details.toToken;
|
|
116
|
-
this.handler(details);
|
|
117
|
-
this.checkAsync();
|
|
118
|
-
break;
|
|
119
|
-
case 'connectionBroken':
|
|
120
|
-
connections.delete(this.id);
|
|
121
|
-
this.handler(details);
|
|
122
|
-
break;
|
|
123
|
-
case 'connectionMessage':
|
|
124
|
-
this.handler(details);
|
|
125
|
-
this.checkAsync();
|
|
126
|
-
break;
|
|
127
|
-
case 'connectionCheck':
|
|
128
|
-
const port = this.messaging.getPort();
|
|
129
|
-
if ( port === null ) { return; }
|
|
130
|
-
if ( connections.has(this.id) ) {
|
|
131
|
-
this.checkAsync();
|
|
132
|
-
} else {
|
|
133
|
-
details.what = 'connectionBroken';
|
|
134
|
-
port.postMessage({ channel: 'vapi', msg: details });
|
|
135
|
-
}
|
|
136
|
-
break;
|
|
137
|
-
case 'connectionRefused':
|
|
138
|
-
connections.delete(this.id);
|
|
139
|
-
this.handler(details);
|
|
140
|
-
break;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
send(payload) {
|
|
144
|
-
const port = this.messaging.getPort();
|
|
145
|
-
if ( port === null ) { return; }
|
|
146
|
-
port.postMessage({
|
|
147
|
-
channel: 'vapi',
|
|
148
|
-
msg: this.toDetails('connectionMessage', payload),
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
static addListener(listener) {
|
|
153
|
-
listeners.add(listener);
|
|
154
|
-
vAPI.messaging.getPort(); // Ensure a port instance exists
|
|
155
|
-
}
|
|
156
|
-
static removeListener(listener) {
|
|
157
|
-
listeners.delete(listener);
|
|
158
|
-
}
|
|
159
|
-
static connectTo(from, to, handler) {
|
|
160
|
-
const port = vAPI.messaging.getPort();
|
|
161
|
-
if ( port === null ) { return; }
|
|
162
|
-
const connection = new vAPI.MessagingConnection(handler, {
|
|
163
|
-
id: `${from}-${to}-${vAPI.sessionId}`,
|
|
164
|
-
to: to,
|
|
165
|
-
from: from,
|
|
166
|
-
fromToken: port.name
|
|
167
|
-
});
|
|
168
|
-
connections.set(connection.id, connection);
|
|
169
|
-
port.postMessage({
|
|
170
|
-
channel: 'vapi',
|
|
171
|
-
msg: {
|
|
172
|
-
what: 'connectionRequested',
|
|
173
|
-
id: connection.id,
|
|
174
|
-
from: from,
|
|
175
|
-
fromToken: port.name,
|
|
176
|
-
to: to,
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
return connection.id;
|
|
180
|
-
}
|
|
181
|
-
static disconnectFrom(connectionId) {
|
|
182
|
-
const connection = connections.get(connectionId);
|
|
183
|
-
if ( connection === undefined ) { return; }
|
|
184
|
-
connection.disconnect();
|
|
185
|
-
}
|
|
186
|
-
static sendTo(connectionId, payload) {
|
|
187
|
-
const connection = connections.get(connectionId);
|
|
188
|
-
if ( connection === undefined ) { return; }
|
|
189
|
-
connection.send(payload);
|
|
190
|
-
}
|
|
191
|
-
static canDestroyPort() {
|
|
192
|
-
return listeners.length === 0 && connections.size === 0;
|
|
193
|
-
}
|
|
194
|
-
static mustDestroyPort() {
|
|
195
|
-
if ( connections.size === 0 ) { return; }
|
|
196
|
-
for ( const connection of connections.values() ) {
|
|
197
|
-
connection.receive({ what: 'connectionBroken' });
|
|
198
|
-
}
|
|
199
|
-
connections.clear();
|
|
200
|
-
}
|
|
201
|
-
static canProcessMessage(details) {
|
|
202
|
-
if ( details.channel !== 'vapi' ) { return; }
|
|
203
|
-
switch ( details.msg.what ) {
|
|
204
|
-
case 'connectionAccepted':
|
|
205
|
-
case 'connectionBroken':
|
|
206
|
-
case 'connectionCheck':
|
|
207
|
-
case 'connectionMessage':
|
|
208
|
-
case 'connectionRefused': {
|
|
209
|
-
const connection = connections.get(details.msg.id);
|
|
210
|
-
if ( connection === undefined ) { break; }
|
|
211
|
-
connection.receive(details.msg);
|
|
212
|
-
return true;
|
|
213
|
-
}
|
|
214
|
-
case 'connectionRequested':
|
|
215
|
-
if ( listeners.length === 0 ) { return; }
|
|
216
|
-
const port = vAPI.messaging.getPort();
|
|
217
|
-
if ( port === null ) { break; }
|
|
218
|
-
let listener, result;
|
|
219
|
-
for ( listener of listeners ) {
|
|
220
|
-
result = listener(details.msg);
|
|
221
|
-
if ( result !== undefined ) { break; }
|
|
222
|
-
}
|
|
223
|
-
if ( result === undefined ) { break; }
|
|
224
|
-
if ( result === true ) {
|
|
225
|
-
details.msg.what = 'connectionAccepted';
|
|
226
|
-
details.msg.toToken = port.name;
|
|
227
|
-
const connection = new vAPI.MessagingConnection(
|
|
228
|
-
listener,
|
|
229
|
-
details.msg
|
|
230
|
-
);
|
|
231
|
-
connections.set(connection.id, connection);
|
|
232
|
-
} else {
|
|
233
|
-
details.msg.what = 'connectionRefused';
|
|
234
|
-
}
|
|
235
|
-
port.postMessage(details);
|
|
236
|
-
return true;
|
|
237
|
-
default:
|
|
238
|
-
break;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
vAPI.messaging.extensions.push(vAPI.MessagingConnection);
|
|
244
|
-
|
|
245
|
-
// <<<<<<<< end of private namespace
|
|
246
|
-
})();
|
|
247
|
-
|
|
248
|
-
/******************************************************************************/
|
|
249
|
-
|
|
250
|
-
// Broadcast listening ability
|
|
251
|
-
|
|
252
|
-
(( ) => {
|
|
253
|
-
// >>>>>>>> start of private namespace
|
|
254
|
-
|
|
255
|
-
if (
|
|
256
|
-
typeof vAPI !== 'object' ||
|
|
257
|
-
vAPI.messaging instanceof Object === false ||
|
|
258
|
-
vAPI.broadcastListener instanceof Object
|
|
259
|
-
) {
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
const listeners = new Set();
|
|
264
|
-
|
|
265
|
-
vAPI.broadcastListener = {
|
|
266
|
-
add: function(listener) {
|
|
267
|
-
listeners.add(listener);
|
|
268
|
-
vAPI.messaging.getPort();
|
|
269
|
-
},
|
|
270
|
-
remove: function(listener) {
|
|
271
|
-
listeners.delete(listener);
|
|
272
|
-
},
|
|
273
|
-
canDestroyPort() {
|
|
274
|
-
return listeners.size === 0;
|
|
275
|
-
},
|
|
276
|
-
mustDestroyPort() {
|
|
277
|
-
listeners.clear();
|
|
278
|
-
},
|
|
279
|
-
canProcessMessage(details) {
|
|
280
|
-
if ( details.broadcast === false ) { return; }
|
|
281
|
-
for ( const listener of listeners ) {
|
|
282
|
-
listener(details.msg);
|
|
283
|
-
}
|
|
284
|
-
},
|
|
285
|
-
};
|
|
286
|
-
|
|
287
|
-
vAPI.messaging.extensions.push(vAPI.broadcastListener);
|
|
288
|
-
|
|
289
|
-
// <<<<<<<< end of private namespace
|
|
290
|
-
})();
|
|
291
|
-
|
|
292
|
-
/******************************************************************************/
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
/*******************************************************************************
|
|
302
|
-
|
|
303
|
-
DO NOT:
|
|
304
|
-
- Remove the following code
|
|
305
|
-
- Add code beyond the following code
|
|
306
|
-
Reason:
|
|
307
|
-
- https://github.com/gorhill/uBlock/pull/3721
|
|
308
|
-
- uBO never uses the return value from injected content scripts
|
|
309
|
-
|
|
310
|
-
**/
|
|
311
|
-
|
|
312
|
-
void 0;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/*******************************************************************************
|
|
2
|
-
|
|
3
|
-
uBlock Origin - a browser extension to block requests.
|
|
4
|
-
Copyright (C) 2019-present Raymond Hill
|
|
5
|
-
|
|
6
|
-
This program is free software: you can redistribute it and/or modify
|
|
7
|
-
it under the terms of the GNU General Public License as published by
|
|
8
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
(at your option) any later version.
|
|
10
|
-
|
|
11
|
-
This program is distributed in the hope that it will be useful,
|
|
12
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
GNU General Public License for more details.
|
|
15
|
-
|
|
16
|
-
You should have received a copy of the GNU General Public License
|
|
17
|
-
along with this program. If not, see {http://www.gnu.org/licenses/}.
|
|
18
|
-
|
|
19
|
-
Home: https://github.com/gorhill/uBlock
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
(function() {
|
|
23
|
-
'use strict';
|
|
24
|
-
const noopfn = function() {
|
|
25
|
-
};
|
|
26
|
-
window.addthis = {
|
|
27
|
-
addEventListener: noopfn,
|
|
28
|
-
button: noopfn,
|
|
29
|
-
counter: noopfn,
|
|
30
|
-
init: noopfn,
|
|
31
|
-
layers: noopfn,
|
|
32
|
-
ready: noopfn,
|
|
33
|
-
sharecounters: {
|
|
34
|
-
getShareCounts: noopfn
|
|
35
|
-
},
|
|
36
|
-
toolbox: noopfn,
|
|
37
|
-
update: noopfn
|
|
38
|
-
};
|
|
39
|
-
})();
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/*******************************************************************************
|
|
2
|
-
|
|
3
|
-
uBlock Origin - a browser extension to block requests.
|
|
4
|
-
Copyright (C) 2019-present Raymond Hill
|
|
5
|
-
|
|
6
|
-
This program is free software: you can redistribute it and/or modify
|
|
7
|
-
it under the terms of the GNU General Public License as published by
|
|
8
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
(at your option) any later version.
|
|
10
|
-
|
|
11
|
-
This program is distributed in the hope that it will be useful,
|
|
12
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
GNU General Public License for more details.
|
|
15
|
-
|
|
16
|
-
You should have received a copy of the GNU General Public License
|
|
17
|
-
along with this program. If not, see {http://www.gnu.org/licenses/}.
|
|
18
|
-
|
|
19
|
-
Home: https://github.com/gorhill/uBlock
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
(function() {
|
|
23
|
-
'use strict';
|
|
24
|
-
self.adProtect = true;
|
|
25
|
-
Object.defineProperties(window, {
|
|
26
|
-
uabpdl: { value: true },
|
|
27
|
-
uabDetect: { value: true }
|
|
28
|
-
});
|
|
29
|
-
})();
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/*******************************************************************************
|
|
2
|
-
|
|
3
|
-
uBlock Origin - a browser extension to block requests.
|
|
4
|
-
Copyright (C) 2019-present Raymond Hill
|
|
5
|
-
|
|
6
|
-
This program is free software: you can redistribute it and/or modify
|
|
7
|
-
it under the terms of the GNU General Public License as published by
|
|
8
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
(at your option) any later version.
|
|
10
|
-
|
|
11
|
-
This program is distributed in the hope that it will be useful,
|
|
12
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
GNU General Public License for more details.
|
|
15
|
-
|
|
16
|
-
You should have received a copy of the GNU General Public License
|
|
17
|
-
along with this program. If not, see {http://www.gnu.org/licenses/}.
|
|
18
|
-
|
|
19
|
-
Home: https://github.com/gorhill/uBlock
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
(function() {
|
|
23
|
-
'use strict';
|
|
24
|
-
const noopfn = function() {
|
|
25
|
-
};
|
|
26
|
-
window.pbjs = { libLoaded: true };
|
|
27
|
-
const mb = window.MonkeyBroker || {
|
|
28
|
-
addAttribute: noopfn,
|
|
29
|
-
addSlot: function(a) {
|
|
30
|
-
this.slots[a.slot] = {};
|
|
31
|
-
},
|
|
32
|
-
defineSlot: noopfn,
|
|
33
|
-
fillSlot: noopfn,
|
|
34
|
-
go: noopfn,
|
|
35
|
-
inventoryConditionalPlacement: noopfn,
|
|
36
|
-
registerSizeCallback: noopfn,
|
|
37
|
-
registerSlotCallback: noopfn,
|
|
38
|
-
slots: {},
|
|
39
|
-
version: ''
|
|
40
|
-
};
|
|
41
|
-
mb.regSlotsMap = mb.slots;
|
|
42
|
-
window.MonkeyBroker = mb;
|
|
43
|
-
})();
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/*******************************************************************************
|
|
2
|
-
|
|
3
|
-
uBlock Origin - a browser extension to block requests.
|
|
4
|
-
Copyright (C) 2021-present Raymond Hill
|
|
5
|
-
|
|
6
|
-
This program is free software: you can redistribute it and/or modify
|
|
7
|
-
it under the terms of the GNU General Public License as published by
|
|
8
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
(at your option) any later version.
|
|
10
|
-
|
|
11
|
-
This program is distributed in the hope that it will be useful,
|
|
12
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
GNU General Public License for more details.
|
|
15
|
-
|
|
16
|
-
You should have received a copy of the GNU General Public License
|
|
17
|
-
along with this program. If not, see {http://www.gnu.org/licenses/}.
|
|
18
|
-
|
|
19
|
-
Home: https://github.com/gorhill/uBlock
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
(function() {
|
|
23
|
-
'use strict';
|
|
24
|
-
// https://developer.mixpanel.com/docs/javascript-full-api-reference
|
|
25
|
-
const mixpanel = {
|
|
26
|
-
get_distinct_id() {
|
|
27
|
-
return '';
|
|
28
|
-
},
|
|
29
|
-
init(t, cfg) {
|
|
30
|
-
if ( cfg instanceof Object === false ) { return; }
|
|
31
|
-
if ( 'loaded' in cfg === false ) { return; }
|
|
32
|
-
if ( cfg.loaded instanceof Function === false ) { return; }
|
|
33
|
-
cfg.loaded();
|
|
34
|
-
},
|
|
35
|
-
register() {
|
|
36
|
-
},
|
|
37
|
-
register_once() {
|
|
38
|
-
},
|
|
39
|
-
track() {
|
|
40
|
-
const cb = Array.from(arguments).pop();
|
|
41
|
-
if ( cb instanceof Function === false ) { return; }
|
|
42
|
-
cb();
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
const q = self.mixpanel && self.mixpanel._i || [];
|
|
46
|
-
self.mixpanel = mixpanel;
|
|
47
|
-
for ( const i of q ) {
|
|
48
|
-
if ( Array.isArray(i) === false ) { continue; }
|
|
49
|
-
mixpanel.init(...i);
|
|
50
|
-
}
|
|
51
|
-
})();
|