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!

發表回覆

登入以回復

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址