Automatic Save to Wayback Machine

Automatically saves the pages you visit into the Wayback Machine.

Verze ze dne 12. 10. 2021. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name	Automatic Save to Wayback Machine
// @namespace      Zopolis4
// @description    Automatically saves the pages you visit into the Wayback Machine.
// @version	2.1.0
// @match	*
// @grant    GM_xmlhttpRequest
// @require https://gitcdn.link/repo/uwx/GM_fetch.ts/fe0cd27fa60efc2975fea55a03d8545ae61aaf34/dist/GM_fetch.js
// @run-at document-start
// ==/UserScript==

function parseURLs() {
  var url = "https://web.archive.org/save/" + location.href;
  if (location.hostname == "web.archive.org") {
    url = "https://web.archive.org/save/" + encodeURI(decodeURI(location.href).replace(/(https?:\/\/)?(www\.)?web\.archive\.org\/(|save|web\/\*\/[0-9]+|web\/[0-9]+|\*\/[0-9]+|web\/\*\/|web|\*\/|[0-9]+)?(\/|id_\/)?/, ""));
  }
  savePages(url);
}
 
function savePages(url) {
  fetch(url, {
    method: "GET",
    headers: {"Content-Type": "application/x-www-form-urlencoded"}
  });
  console.log(url);
}

document.addEventListener("DOMContentLoaded", parseURLs);