diff --git a/background.js b/background.js index f89d4aa..8116170 100644 --- a/background.js +++ b/background.js @@ -63,21 +63,21 @@ chrome.contextMenus.onClicked.addListener(function(info, tab) { url = info.linkUrl; } if (id.startsWith('resurrect-google-')) { - goToUrl(genGoogleUrl(url), openIn); + goToUrl(genGoogleUrl(url), openIn, tab.id); } else if (id.startsWith('resurrect-googletext-')) { - goToUrl(genGoogleTextUrl(url), openIn); + goToUrl(genGoogleTextUrl(url), openIn, tab.id); } else if (id.startsWith('resurrect-archive-')) { - goToUrl(genIaUrl(url), openIn); + goToUrl(genIaUrl(url), openIn, tab.id); } else if (id.startsWith('resurrect-archivelist-')) { - goToUrl(genIaListUrl(url), openIn); + goToUrl(genIaListUrl(url), openIn, tab.id); } else if (id.startsWith('resurrect-archiveis-')) { - goToUrl(genArchiveIsUrl(url), openIn); + goToUrl(genArchiveIsUrl(url), openIn, tab.id); } else if (id.startsWith('resurrect-isup-')) { - goToUrl(genIsUpUrl(url), openIn); + goToUrl(genIsUpUrl(url), openIn, tab.id); } else if (id.startsWith('resurrect-webcitation-')) { - goToUrl(genWebCiteUrl(url), openIn); + goToUrl(genWebCiteUrl(url), openIn, tab.id); } else if (id.startsWith('resurrect-mementoweb-')) { - goToUrl(genMementoUrl(url), openIn); + goToUrl(genMementoUrl(url), openIn, tab.id); } else if (id.startsWith('resurrect-current-tab-')) { setOpenIn(openInEnum.CURRENT_TAB); } else if (id.startsWith('resurrect-new-tab-')) { diff --git a/common.js b/common.js index 66e0bce..55967ce 100644 --- a/common.js +++ b/common.js @@ -37,7 +37,7 @@ function genIaListUrl(url) { } function genArchiveIsUrl(url) { - return 'https://archive.md/'+url; + return 'https://archive.ph/'+url; } function genWebCiteUrl(url) { @@ -77,16 +77,16 @@ function updateContextRadios() { }); } -function goToUrl(url, where) { +function goToUrl(url, where, openerTabId) { switch(Number(where)) { case openInEnum.CURRENT_TAB: chrome.tabs.update({'url': url}); break; case openInEnum.NEW_TAB: - chrome.tabs.create({'url': url}); + chrome.tabs.create({'url': url, openerTabId}); break; case openInEnum.NEW_BGTAB: - chrome.tabs.create({'url': url, 'active': false}); + chrome.tabs.create({'url': url, 'active': false, openerTabId}); break; case openInEnum.NEW_WINDOW: chrome.windows.create({'url': url}); diff --git a/manifest.json b/manifest.json index 48e8b2e..326ae6b 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "name": "__MSG_extensionName__", "short_name": "__MSG_extensionName__", "description": "__MSG_extensionDescription__", - "version": "6.2", + "version": "6.2.1", "default_locale": "en", "homepage_url": "https://github.com/Albirew/resurrect-pages", diff --git a/popup.js b/popup.js index a67698e..fb32b88 100644 --- a/popup.js +++ b/popup.js @@ -23,7 +23,7 @@ function resurrect(gen) { logLastError(); let url = gen(tabObj[0].url); console.info('Resurrecting via URL', url); - goToUrl(url, openIn); + goToUrl(url, openIn, tabObj[0].id); window.close(); }); }