Update Archive Site Links to 1.1.0

- Show archive links even for the same archiver
This commit is contained in:
blankie 2023-08-30 11:27:05 +10:00
parent a91831ee70
commit 387213d063
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 9 additions and 11 deletions

View File

@ -4,7 +4,7 @@
// @match http*://*/*
// @grant GM_openInTab
// @grant GM_registerMenuCommand
// @version 1.0.0
// @version 1.1.0
// @author blankie
// @description Adds buttons to the monkey menu to open/archive in the Wayback Machine and archive.today
// @inject-into content
@ -72,21 +72,19 @@ for (const ARCHIVE_SITE of ARCHIVE_SITES) {
let archiveSites = 0;
for (const ARCHIVE_SITE of ARCHIVE_SITES) {
if (onArchiveSite === ARCHIVE_SITE) {
continue;
}
if (archiveSites !== 0) {
GM_registerMenuCommand("=".repeat(20) + "\u200B".repeat(archiveSites), function() {});
}
archiveSites++;
GM_registerMenuCommand(`Open in ${ARCHIVE_SITE.name}`, function() {
window.location.href = ARCHIVE_SITE.getArchivedUrl(url);
});
GM_registerMenuCommand(`Open in ${ARCHIVE_SITE.name} (new tab)`, function() {
GM_openInTab(ARCHIVE_SITE.getArchivedUrl(url));
});
if (ARCHIVE_SITE !== onArchiveSite) {
GM_registerMenuCommand(`Open in ${ARCHIVE_SITE.name}`, function() {
window.location.href = ARCHIVE_SITE.getArchivedUrl(url);
});
GM_registerMenuCommand(`Open in ${ARCHIVE_SITE.name} (new tab)`, function() {
GM_openInTab(ARCHIVE_SITE.getArchivedUrl(url));
});
}
let urlObject = new URL(url);
urlObject.hash = "";