ARCHIVE

Aggiunge comandi al menu di Tampermonkey per accedere a versioni archiviate della pagina corrente

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         ARCHIVE
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Aggiunge comandi al menu di Tampermonkey per accedere a versioni archiviate della pagina corrente
// @author       SH3LL
// @match        *://*/*
// @grant        GM_registerMenuCommand
// @icon         https://i.postimg.cc/L8cP5JMV/icon.png
// ==/UserScript==

(function() {
    'use strict';

    // Open in Wayback Machine
    function openWaybackMachine() {
        const currentUrl = window.location.href;
        window.open('https://web.archive.org/web/*/' + currentUrl, '_blank');
    }

    // Open in Archive.is
    function openArchiveToday() {
        const currentUrl = window.location.href;
        window.open('https://archive.is/' + currentUrl, '_blank');
    }

    // Save in Wayback Machine
    function saveToWaybackMachine() {
        const currentUrl = window.location.href;
        window.open('https://web.archive.org/save/' + currentUrl, '_blank');
    }

    // Save in Archive.is
    function saveToArchiveToday() {
        const currentUrl = window.location.href;
        window.open('https://archive.is/?run=1&url=' + encodeURIComponent(currentUrl), '_blank');
    }

    // MENU
    GM_registerMenuCommand('[🔍️]-web.archive.org', openWaybackMachine);
    GM_registerMenuCommand('[🔍️]-archive.is', openArchiveToday);
    GM_registerMenuCommand('[💾]-web.archive.org', saveToWaybackMachine);
    GM_registerMenuCommand('[💾]-archive.is', saveToArchiveToday);
})();