Skip to content

Commit ef6fd2d

Browse files
committed
#11 Removed lastAccessed check before tab processing
1 parent 03a97a8 commit ef6fd2d

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

background.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use strict";
22

33
function debug() {
4-
// console.debug.apply(console, arguments);
4+
//console.debug.apply(console, arguments);
55
}
66

77
function handleError() {
@@ -128,7 +128,9 @@ async function tryReuseTab(tab) {
128128
const duplicate = await findDuplicate(tab);
129129
if (duplicate) {
130130
await reopenIn(tab, duplicate);
131+
return true;
131132
}
133+
return false;
132134
}
133135

134136
tabs.onCreated.addListener(tab => {
@@ -148,13 +150,9 @@ tabs.onUpdated.addListener((tabId, change, tab) => {
148150
const watched = watchedTabs[tabId];
149151
if (!watched)
150152
return;
151-
// If user has interacted with tab, it should not be closed, handle only automated redirects.
152-
if (watched.created != tab.lastAccessed) {
153-
debug("Interaction detected with tab",tabId);
154-
delete watchedTabs[tabId];
155-
return;
156-
}
157-
tryReuseTab(tab).catch(e => handleError(e));
153+
tryReuseTab(tab)
154+
.then(reused => delete watchedTabs[tabId])
155+
.catch(e => handleError(e));
158156
});
159157

160158
debug("startup complete");

0 commit comments

Comments
 (0)