1
1
Bifurcation 0

Specify openerTabId for opened tabs

See https://github.com/arantius/resurrect-pages/pull/44
Cette révision appartient à :
Albirew 2019-12-12 22:05:41 +01:00
Parent 16d1af6868
révision ca7773baf7
4 fichiers modifiés avec 14 ajouts et 14 suppressions

Voir le fichier

@ -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-')) {

Voir le fichier

@ -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});

Voir le fichier

@ -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",

Voir le fichier

@ -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();
});
}