Skip to content

Commit

Permalink
Fix Deletes History Container not cleaning history with deactivated a…
Browse files Browse the repository at this point in the history
…utomatic mode

Part of #17
  • Loading branch information
stoically committed Feb 4, 2018
1 parent 8cffec6 commit 282e2ee
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/background/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@ class Request {
debug('[browser.webRequest.onBeforeRequest] onBeforeRequest request doesnt belong to a tab, why are you main_frame?', request);
return;
}
let alwaysOpenIn = false;
if (this.shouldAlwaysOpenInTemporaryContainer(request)) {
debug('[browser.webRequest.onBeforeRequest] always open in tmpcontainer request', request);
alwaysOpenIn = true;
} else if (!this.storage.local.preferences.automaticMode &&
!this.mouseclick.linksClicked[request.url]) {
debug('[browser.webRequest.onBeforeRequest] automatic mode disabled and no link clicked', request);
return;
}

let tab;
try {
Expand Down Expand Up @@ -52,6 +43,16 @@ class Request {
await this.storage.persist();
}

let alwaysOpenIn = false;
if (this.shouldAlwaysOpenInTemporaryContainer(request)) {
debug('[browser.webRequest.onBeforeRequest] always open in tmpcontainer request', request);
alwaysOpenIn = true;
} else if (!this.storage.local.preferences.automaticMode &&
!this.mouseclick.linksClicked[request.url]) {
debug('[browser.webRequest.onBeforeRequest] automatic mode disabled and no link clicked', request);
return;
}

if (alwaysOpenIn && !this.mouseclick.linksClicked[request.url] && tab.openerTabId) {
debug('[browser.webRequest.onBeforeRequest] always open in tmpcontainer request, simulating click', request);
this.linkClicked(request.url, {
Expand Down

0 comments on commit 282e2ee

Please sign in to comment.