Wayback Machine

Add context menu option to open links in the latest archive on the Wayback Machine

< 脚本Wayback Machine的反馈

评价:好评 - 脚本运行良好

§
发表于:2024-02-08

Working nicely, Thanks! [Firefox 115.6.0esr, Tampermonkey 5.0.1]

I wish we didn't need to use the Tampermonkey context menu; anyway to add to a browser's native context-menu? Firefox, Chrome, etc

Also, I modified script to have 'First' and 'Last' archive options (taking inspiration from drhouse's simple but invaluable Archive.org Wayback Machine - First Archive Version

    GM_registerMenuCommand("First in Wayback Machine", function() {
        if (lastRightClickedElement && lastRightClickedElement.href) {
            const wayFirstUrl = `https://web.archive.org/web/1000/${lastRightClickedElement.href}`; // "1000" redirects to the First archive
            GM_openInTab(wayFirstUrl, { active: true });
        }
    });
    GM_registerMenuCommand("Last in Wayback Machine", function() {
        if (lastRightClickedElement && lastRightClickedElement.href) {
            const wayLastUrl = `https://web.archive.org/web/2/${lastRightClickedElement.href}`; // "2" redirects to the latest archive
            GM_openInTab(wayLastUrl, { active: true });
        }
    });

But I defer to your great work if you have a better way of coding this.

Lastly, PLEASE change the name to something more unique and/or descriptive!

发表回复

登录以发表回复。