mirror of https://github.com/gorhill/uBlock.git
code review: don't remember tabless network requests in behind-the-scene scope
This commit is contained in:
parent
0364087e11
commit
2f1d319072
|
@ -95,6 +95,7 @@ NetFilteringResultCache.prototype.rememberResult = function(
|
|||
result,
|
||||
logData
|
||||
) {
|
||||
if ( fctxt.tabId <= 0 ) { return; }
|
||||
if ( this.results.size === 0 ) {
|
||||
this.pruneAsync();
|
||||
}
|
||||
|
@ -113,6 +114,7 @@ NetFilteringResultCache.prototype.rememberResult = function(
|
|||
/******************************************************************************/
|
||||
|
||||
NetFilteringResultCache.prototype.rememberBlock = function(fctxt) {
|
||||
if ( fctxt.tabId <= 0 ) { return; }
|
||||
if ( this.blocked.size === 0 ) {
|
||||
this.pruneAsync();
|
||||
}
|
||||
|
|
|
@ -283,7 +283,14 @@ const onBeforeBehindTheSceneRequest = function(fctxt) {
|
|||
|
||||
let result = 0;
|
||||
|
||||
// https://github.com/uBlockOrigin/uBlock-issues/issues/339
|
||||
// Need to also test against `-scheme` since tabOrigin is normalized.
|
||||
// Not especially elegant but for now this accomplishes the purpose of
|
||||
// not dealing with network requests fired from a synthetic scope,
|
||||
// that is unless advanced user mode is enabled.
|
||||
|
||||
if (
|
||||
fctxt.tabOrigin.endsWith('-scheme') === false &&
|
||||
µb.URI.isNetworkURI(fctxt.tabOrigin) ||
|
||||
µb.userSettings.advancedUserEnabled ||
|
||||
fctxt.type === 'csp_report'
|
||||
|
@ -303,8 +310,6 @@ const onBeforeBehindTheSceneRequest = function(fctxt) {
|
|||
}
|
||||
}
|
||||
|
||||
pageStore.journalAddRequest(fctxt.getHostname(), result);
|
||||
|
||||
if ( µb.logger.enabled ) {
|
||||
fctxt.setRealm('net').toLogger();
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
</select>
|
||||
<span id="refresh" class="button fa disabled needdom"></span>
|
||||
<span id="showdom" class="button fa disabled needdom"></span>
|
||||
<span id="showpopup" class="button disabled needscope"><img src="/img/icon_64.png"></span>
|
||||
<span id="showpopup" class="button disabled needdom"><img src="/img/icon_64.png"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in New Issue