Skip to content

Commit

Permalink
Reenable auto reload of suspended tabs that receive focus after the c…
Browse files Browse the repository at this point in the history
…losing of another tab (#519)
  • Loading branch information
deanoemcke committed Aug 18, 2017
1 parent 4f37e15 commit 3e20811
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ var tgs = (function () {
unsuspendOnReloadByTabId = {},
temporaryWhitelistOnReloadByTabId = {},
scrollPosByTabId = {},
lastTabCloseTimestamp = new Date(),
suspensionActiveIcon = '/img/icon19.png',
suspensionPausedIcon = '/img/icon19b.png';

Expand Down Expand Up @@ -432,13 +431,6 @@ var tgs = (function () {
updateIcon(info.status);
});

//check to see if we have just recently removed a tab
//if so, assume this is an 'accidental' tab focus and do not unsuspend
if (lastTabCloseTimestamp > (new Date()) - 500) {
if (debug) console.log('ignoring tab focus');
return;
}

//pause for a bit before assuming we're on a new tab as some users
//will key through intermediate tabs to get to the one they want.
(function () {
Expand Down Expand Up @@ -1031,7 +1023,6 @@ var tgs = (function () {
queueSessionTimer();
delete unsuspendOnReloadByTabId[tabId];
delete temporaryWhitelistOnReloadByTabId[tabId];
lastTabCloseTimestamp = new Date();
});
chrome.webNavigation.onCreatedNavigationTarget.addListener(function (details) {
var instantlySuspend = gsUtils.getOption(gsUtils.INSTANT_SUSPEND);
Expand Down

0 comments on commit 3e20811

Please sign in to comment.