Skip to content

Commit 7820475

Browse files
committed
bootstrap: rewrite new blocking system
1 parent 1f0ac0f commit 7820475

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/bootstrap.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,12 @@ const startCore = () => {
7575
};
7676

7777
const startUpdate = () => {
78-
session.defaultSession.webRequest.onBeforeRequest({ urls: [ 'https://a.invalid/a',
78+
const urls = [
7979
oaConfig.noTrack !== false ? 'https://*/api/v9/science' : '',
8080
oaConfig.noTyping === true ? 'https://*/api/*/typing' : ''
81-
].filter(x => x) }, (e, cb) => cb({ cancel: true }));
81+
].filter(x => x);
82+
83+
if (urls.length > 0) session.defaultSession.webRequest.onBeforeRequest({ urls }, (e, cb) => cb({ cancel: true }));
8284

8385
const startMin = process.argv?.includes?.('--start-minimized');
8486

@@ -110,7 +112,7 @@ const startUpdate = () => {
110112
const config = require('./config');
111113
if (oaConfig.setup !== true) config.open();
112114

113-
if (oaConfig.autoupdate !== false) { // If autoupdate disabled, don't update
115+
if (oaConfig.autoupdate !== false) {
114116
try {
115117
require('./asarUpdate')();
116118
} catch (e) {

0 commit comments

Comments
 (0)