Specify openerTabId for opened tabs
See https://github.com/arantius/resurrect-pages/pull/44
Cette révision appartient à :
Parent
16d1af6868
révision
ca7773baf7
4 fichiers modifiés avec 14 ajouts et 14 suppressions
|
@ -63,21 +63,21 @@ chrome.contextMenus.onClicked.addListener(function(info, tab) {
|
||||||
url = info.linkUrl;
|
url = info.linkUrl;
|
||||||
}
|
}
|
||||||
if (id.startsWith('resurrect-google-')) {
|
if (id.startsWith('resurrect-google-')) {
|
||||||
goToUrl(genGoogleUrl(url), openIn);
|
goToUrl(genGoogleUrl(url), openIn, tab.id);
|
||||||
} else if (id.startsWith('resurrect-googletext-')) {
|
} else if (id.startsWith('resurrect-googletext-')) {
|
||||||
goToUrl(genGoogleTextUrl(url), openIn);
|
goToUrl(genGoogleTextUrl(url), openIn, tab.id);
|
||||||
} else if (id.startsWith('resurrect-archive-')) {
|
} else if (id.startsWith('resurrect-archive-')) {
|
||||||
goToUrl(genIaUrl(url), openIn);
|
goToUrl(genIaUrl(url), openIn, tab.id);
|
||||||
} else if (id.startsWith('resurrect-archivelist-')) {
|
} else if (id.startsWith('resurrect-archivelist-')) {
|
||||||
goToUrl(genIaListUrl(url), openIn);
|
goToUrl(genIaListUrl(url), openIn, tab.id);
|
||||||
} else if (id.startsWith('resurrect-archiveis-')) {
|
} else if (id.startsWith('resurrect-archiveis-')) {
|
||||||
goToUrl(genArchiveIsUrl(url), openIn);
|
goToUrl(genArchiveIsUrl(url), openIn, tab.id);
|
||||||
} else if (id.startsWith('resurrect-isup-')) {
|
} else if (id.startsWith('resurrect-isup-')) {
|
||||||
goToUrl(genIsUpUrl(url), openIn);
|
goToUrl(genIsUpUrl(url), openIn, tab.id);
|
||||||
} else if (id.startsWith('resurrect-webcitation-')) {
|
} else if (id.startsWith('resurrect-webcitation-')) {
|
||||||
goToUrl(genWebCiteUrl(url), openIn);
|
goToUrl(genWebCiteUrl(url), openIn, tab.id);
|
||||||
} else if (id.startsWith('resurrect-mementoweb-')) {
|
} else if (id.startsWith('resurrect-mementoweb-')) {
|
||||||
goToUrl(genMementoUrl(url), openIn);
|
goToUrl(genMementoUrl(url), openIn, tab.id);
|
||||||
} else if (id.startsWith('resurrect-current-tab-')) {
|
} else if (id.startsWith('resurrect-current-tab-')) {
|
||||||
setOpenIn(openInEnum.CURRENT_TAB);
|
setOpenIn(openInEnum.CURRENT_TAB);
|
||||||
} else if (id.startsWith('resurrect-new-tab-')) {
|
} else if (id.startsWith('resurrect-new-tab-')) {
|
||||||
|
|
|
@ -37,7 +37,7 @@ function genIaListUrl(url) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function genArchiveIsUrl(url) {
|
function genArchiveIsUrl(url) {
|
||||||
return 'https://archive.md/'+url;
|
return 'https://archive.ph/'+url;
|
||||||
}
|
}
|
||||||
|
|
||||||
function genWebCiteUrl(url) {
|
function genWebCiteUrl(url) {
|
||||||
|
@ -77,16 +77,16 @@ function updateContextRadios() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function goToUrl(url, where) {
|
function goToUrl(url, where, openerTabId) {
|
||||||
switch(Number(where)) {
|
switch(Number(where)) {
|
||||||
case openInEnum.CURRENT_TAB:
|
case openInEnum.CURRENT_TAB:
|
||||||
chrome.tabs.update({'url': url});
|
chrome.tabs.update({'url': url});
|
||||||
break;
|
break;
|
||||||
case openInEnum.NEW_TAB:
|
case openInEnum.NEW_TAB:
|
||||||
chrome.tabs.create({'url': url});
|
chrome.tabs.create({'url': url, openerTabId});
|
||||||
break;
|
break;
|
||||||
case openInEnum.NEW_BGTAB:
|
case openInEnum.NEW_BGTAB:
|
||||||
chrome.tabs.create({'url': url, 'active': false});
|
chrome.tabs.create({'url': url, 'active': false, openerTabId});
|
||||||
break;
|
break;
|
||||||
case openInEnum.NEW_WINDOW:
|
case openInEnum.NEW_WINDOW:
|
||||||
chrome.windows.create({'url': url});
|
chrome.windows.create({'url': url});
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"name": "__MSG_extensionName__",
|
"name": "__MSG_extensionName__",
|
||||||
"short_name": "__MSG_extensionName__",
|
"short_name": "__MSG_extensionName__",
|
||||||
"description": "__MSG_extensionDescription__",
|
"description": "__MSG_extensionDescription__",
|
||||||
"version": "6.2",
|
"version": "6.2.1",
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"homepage_url": "https://github.com/Albirew/resurrect-pages",
|
"homepage_url": "https://github.com/Albirew/resurrect-pages",
|
||||||
|
|
||||||
|
|
2
popup.js
2
popup.js
|
@ -23,7 +23,7 @@ function resurrect(gen) {
|
||||||
logLastError();
|
logLastError();
|
||||||
let url = gen(tabObj[0].url);
|
let url = gen(tabObj[0].url);
|
||||||
console.info('Resurrecting via URL', url);
|
console.info('Resurrecting via URL', url);
|
||||||
goToUrl(url, openIn);
|
goToUrl(url, openIn, tabObj[0].id);
|
||||||
window.close();
|
window.close();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Chargement…
Référencer dans un nouveau ticket