Skip to content

Commit 4aedad9

Browse files
committed
Specify openerTabId for opened tabs
1 parent b751a29 commit 4aedad9

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

background.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,19 @@ chrome.contextMenus.onClicked.addListener(function(info, tab) {
7676
}
7777

7878
if (id.startsWith('resurrect-google-')) {
79-
goToUrl(genGoogleUrl(url), openIn);
79+
goToUrl(genGoogleUrl(url), openIn, tab.id);
8080
} else if (id.startsWith('resurrect-googletext-')) {
81-
goToUrl(genGoogleTextUrl(url), openIn);
81+
goToUrl(genGoogleTextUrl(url), openIn, tab.id);
8282
} else if (id.startsWith('resurrect-archive-')) {
83-
goToUrl(genIaUrl(url), openIn);
83+
goToUrl(genIaUrl(url), openIn, tab.id);
8484
} else if (id.startsWith('resurrect-archivelist-')) {
85-
goToUrl(genIaListUrl(url), openIn);
85+
goToUrl(genIaListUrl(url), openIn, tab.id);
8686
} else if (id.startsWith('resurrect-archiveis-')) {
87-
goToUrl(genArchiveIsUrl(url), openIn);
87+
goToUrl(genArchiveIsUrl(url), openIn, tab.id);
8888
} else if (id.startsWith('resurrect-webcitation-')) {
89-
goToUrl(genWebCiteUrl(url), openIn);
89+
goToUrl(genWebCiteUrl(url), openIn, tab.id);
9090
} else if (id.startsWith('resurrect-mementoweb-')) {
91-
goToUrl(genMementoUrl(url), openIn);
91+
goToUrl(genMementoUrl(url), openIn, tab.id);
9292
} else if (id.startsWith('resurrect-current-tab-')) {
9393
setOpenIn(openInEnum.CURRENT_TAB);
9494
} else if (id.startsWith('resurrect-new-tab-')) {

common.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,16 @@ function updateContextRadios() {
7979
}
8080

8181

82-
function goToUrl(url, where) {
82+
function goToUrl(url, where, openerTabId) {
8383
switch(Number(where)) {
8484
case openInEnum.CURRENT_TAB:
8585
chrome.tabs.update({'url': url});
8686
break;
8787
case openInEnum.NEW_TAB:
88-
chrome.tabs.create({'url': url});
88+
chrome.tabs.create({'url': url, openerTabId});
8989
break;
9090
case openInEnum.NEW_BGTAB:
91-
chrome.tabs.create({'url': url, 'active': false});
91+
chrome.tabs.create({'url': url, 'active': false, openerTabId});
9292
break;
9393
case openInEnum.NEW_WINDOW:
9494
chrome.windows.create({'url': url});

popup.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function resurrect(gen) {
1919
logLastError();
2020
let url = gen(tabObj[0].url);
2121
console.info('Resurrecting via URL', url);
22-
goToUrl(url, openIn);
22+
goToUrl(url, openIn, tabObj[0].id);
2323
window.close();
2424
});
2525
}

0 commit comments

Comments
 (0)