summaryrefslogtreecommitdiffstats
path: root/src/js/background.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/background.js')
-rw-r--r--src/js/background.js51
1 files changed, 21 insertions, 30 deletions
diff --git a/src/js/background.js b/src/js/background.js
index 578d8a6..edeac08 100644
--- a/src/js/background.js
+++ b/src/js/background.js
@@ -19,22 +19,18 @@
Home: https://github.com/gorhill/uBlock
*/
-/* globals browser */
-
-'use strict';
-
/******************************************************************************/
-import logger from './logger.js';
-import { FilteringContext } from './filtering-context.js';
-import { ubologSet } from './console.js';
-
import {
domainFromHostname,
hostnameFromURI,
originFromURI,
} from './uri-utils.js';
+import { FilteringContext } from './filtering-context.js';
+import logger from './logger.js';
+import { ubologSet } from './console.js';
+
/******************************************************************************/
// Not all platforms may have properly declared vAPI.webextFlavor.
@@ -49,13 +45,14 @@ const hiddenSettingsDefault = {
allowGenericProceduralFilters: false,
assetFetchTimeout: 30,
autoCommentFilterTemplate: '{{date}} {{origin}}',
- autoUpdateAssetFetchPeriod: 15,
- autoUpdateDelayAfterLaunch: 105,
+ autoUpdateAssetFetchPeriod: 5,
+ autoUpdateDelayAfterLaunch: 37,
autoUpdatePeriod: 1,
benchmarkDatasetURL: 'unset',
blockingProfiles: '11111/#F00 11010/#C0F 11001/#00F 00001',
- cacheStorageAPI: 'unset',
cacheStorageCompression: true,
+ cacheStorageCompressionThreshold: 65536,
+ cacheStorageMultithread: 2,
cacheControlForFirefox1376932: 'no-cache, no-store, must-revalidate',
cloudStorageCompression: true,
cnameIgnoreList: 'unset',
@@ -78,10 +75,12 @@ const hiddenSettingsDefault = {
modifyWebextFlavor: 'unset',
popupFontSize: 'unset',
popupPanelDisabledSections: 0,
- popupPanelLockedSections: 0,
popupPanelHeightMode: 0,
+ popupPanelLockedSections: 0,
+ popupPanelOrientation: 'unset',
requestJournalProcessPeriod: 1000,
- selfieAfter: 2,
+ requestStatsDisabled: false,
+ selfieDelayInSeconds: 53,
strictBlockingBypassDuration: 120,
toolbarWarningTimeout: 60,
trustedListPrefixes: 'ublock-',
@@ -93,7 +92,7 @@ const hiddenSettingsDefault = {
if ( vAPI.webextFlavor.soup.has('devbuild') ) {
hiddenSettingsDefault.consoleLogLevel = 'info';
- hiddenSettingsDefault.trustedListPrefixes += ' user-';
+ hiddenSettingsDefault.cacheStorageAPI = 'unset';
ubologSet(true);
}
@@ -112,7 +111,7 @@ const userSettingsDefault = {
externalLists: '',
firewallPaneMinimized: true,
hyperlinkAuditingDisabled: true,
- ignoreGenericCosmeticFilters: vAPI.webextFlavor.soup.has('mobile'),
+ ignoreGenericCosmeticFilters: false,
importedLists: [],
largeMediaSize: 50,
parseAllABPHideFilters: true,
@@ -122,6 +121,7 @@ const userSettingsDefault = {
showIconBadge: true,
suspendUntilListsAreLoaded: vAPI.Net.canSuspend(),
tooltipsDisabled: false,
+ userFiltersTrusted: false,
webrtcIPAddressHidden: false,
};
@@ -144,7 +144,7 @@ if ( vAPI.webextFlavor.soup.has('firefox') ) {
}
const µBlock = { // jshint ignore:line
- wakeupReason: '',
+ alarmQueue: [],
userSettingsDefault,
userSettings: Object.assign({}, userSettingsDefault),
@@ -168,26 +168,19 @@ const µBlock = { // jshint ignore:line
netWhitelist: new Map(),
netWhitelistModifyTime: 0,
netWhitelistDefault: [
- 'about-scheme',
'chrome-extension-scheme',
- 'chrome-scheme',
- 'edge-scheme',
'moz-extension-scheme',
- 'opera-scheme',
- 'vivaldi-scheme',
- 'wyciwyg-scheme', // Firefox's "What-You-Cache-Is-What-You-Get"
],
- localSettings: {
- blockedRequestCount: 0,
- allowedRequestCount: 0,
+ requestStats: {
+ blockedCount: 0,
+ allowedCount: 0,
},
- localSettingsLastModified: 0,
// Read-only
systemSettings: {
compiledMagic: 57, // Increase when compiled format changes
- selfieMagic: 57, // Increase when selfie format changes
+ selfieMagic: 58, // Increase when selfie format changes
},
// https://github.com/uBlockOrigin/uBlock-issues/issues/759#issuecomment-546654501
@@ -311,7 +304,6 @@ const µBlock = { // jshint ignore:line
}
this.fromTabId(tabId); // Must be called AFTER tab context management
this.realm = '';
- this.id = details.requestId;
this.setMethod(details.method);
this.setURL(details.url);
this.aliasURL = details.aliasURL || undefined;
@@ -373,8 +365,7 @@ const µBlock = { // jshint ignore:line
toLogger() {
const details = {
- id: this.id,
- tstamp: Date.now(),
+ tstamp: 0,
realm: this.realm,
method: this.getMethodName(),
type: this.stype,