summaryrefslogtreecommitdiffstats
path: root/src/js/pagestore.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 05:50:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 05:50:18 +0000
commit55a5d29a66503248916f249ad2a1d8b37cde5a03 (patch)
treea3beb6a90dd3bdaaf67ecb05d42152a494aff946 /src/js/pagestore.js
parentAdding upstream version 1.55.0+dfsg. (diff)
downloadublock-origin-55a5d29a66503248916f249ad2a1d8b37cde5a03.tar.xz
ublock-origin-55a5d29a66503248916f249ad2a1d8b37cde5a03.zip
Adding upstream version 1.57.0+dfsg.upstream/1.57.0+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/js/pagestore.js')
-rw-r--r--src/js/pagestore.js44
1 files changed, 21 insertions, 23 deletions
diff --git a/src/js/pagestore.js b/src/js/pagestore.js
index 907e747..227352d 100644
--- a/src/js/pagestore.js
+++ b/src/js/pagestore.js
@@ -19,17 +19,13 @@
Home: https://github.com/gorhill/uBlock
*/
-'use strict';
-
/******************************************************************************/
-import contextMenu from './contextmenu.js';
-import logger from './logger.js';
-import staticNetFilteringEngine from './static-net-filtering.js';
-import µb from './background.js';
-import webext from './webext.js';
-import { orphanizeString } from './text-utils.js';
-import { redirectEngine } from './redirect-engine.js';
+import {
+ domainFromHostname,
+ hostnameFromURI,
+ isNetworkURI,
+} from './uri-utils.js';
import {
sessionFirewall,
@@ -37,11 +33,13 @@ import {
sessionURLFiltering,
} from './filtering-engines.js';
-import {
- domainFromHostname,
- hostnameFromURI,
- isNetworkURI,
-} from './uri-utils.js';
+import contextMenu from './contextmenu.js';
+import logger from './logger.js';
+import { orphanizeString } from './text-utils.js';
+import { redirectEngine } from './redirect-engine.js';
+import staticNetFilteringEngine from './static-net-filtering.js';
+import webext from './webext.js';
+import µb from './background.js';
/*******************************************************************************
@@ -379,11 +377,13 @@ const PageStore = class {
// If we are navigating from-to same site, remember whether large
// media elements were temporarily allowed.
- if (
- typeof this.allowLargeMediaElementsUntil !== 'number' ||
- tabContext.rootHostname !== this.tabHostname
- ) {
- this.allowLargeMediaElementsUntil = Date.now();
+ const now = Date.now();
+ if ( typeof this.allowLargeMediaElementsUntil !== 'number' ) {
+ this.allowLargeMediaElementsUntil = now;
+ } else if ( tabContext.rootHostname !== this.tabHostname ) {
+ if ( this.tabHostname.endsWith('about-scheme') === false ) {
+ this.allowLargeMediaElementsUntil = now;
+ }
}
this.tabHostname = tabContext.rootHostname;
@@ -739,10 +739,8 @@ const PageStore = class {
aggregateAllowed += 1;
}
}
- if ( aggregateAllowed !== 0 || aggregateBlocked !== 0 ) {
- µb.localSettings.blockedRequestCount += aggregateBlocked;
- µb.localSettings.allowedRequestCount += aggregateAllowed;
- µb.localSettingsLastModified = now;
+ if ( aggregateAllowed || aggregateBlocked ) {
+ µb.incrementRequestStats(aggregateBlocked, aggregateAllowed);
}
journal.length = 0;
}