Skip to content

Commit

Permalink
bootstrap: rewrite new blocking system
Browse files Browse the repository at this point in the history
  • Loading branch information
CanadaHonk committed Sep 29, 2022
1 parent 1f0ac0f commit 7820475
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,12 @@ const startCore = () => {
};

const startUpdate = () => {
session.defaultSession.webRequest.onBeforeRequest({ urls: [ 'https://a.invalid/a',
const urls = [
oaConfig.noTrack !== false ? 'https://*/api/v9/science' : '',
oaConfig.noTyping === true ? 'https://*/api/*/typing' : ''
].filter(x => x) }, (e, cb) => cb({ cancel: true }));
].filter(x => x);

if (urls.length > 0) session.defaultSession.webRequest.onBeforeRequest({ urls }, (e, cb) => cb({ cancel: true }));

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

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

if (oaConfig.autoupdate !== false) { // If autoupdate disabled, don't update
if (oaConfig.autoupdate !== false) {
try {
require('./asarUpdate')();
} catch (e) {
Expand Down

0 comments on commit 7820475

Please sign in to comment.