Web Archive Save Link

Adds a save button to web archive pages.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @icon         http://web.archive.org/favicon.ico
// @name         Web Archive Save Link
// @version      2.0.0
// @description  Adds a save button to web archive pages.
// @author       Benji Grant
// @license      MIT
// @match        https://web.archive.org/web/*
// @match        http://web.archive.org/web/*
// @grant        none
// @namespace    https://greasyfork.org/users/4072
// ==/UserScript==

document.body.addEventListener('load', () => {
  const pageURL = window.location.pathname.replace(/\/web\/\d+\//, '')

  const saveLink = document.createElement('a')
  saveLink.href = `https://web.archive.org/save/${encodeURIComponent(pageURL)}`
  saveLink.style.fontFamily = 'sans-serif'
  saveLink.style.fontSize = '14px'
  saveLink.style.color = 'initial'
  saveLink.style.display = 'inline-block'
  saveLink.style.background = 'rgba(255,255,255,0.9)'
  saveLink.style.border = '5px solid black'
  saveLink.style.borderTop = '0'
  saveLink.style.borderRadius = '0 0 8px 8px'
  saveLink.style.boxShadow = '1px 1px 4px #333'
  saveLink.style.position = 'fixed'
  saveLink.style.top = '65px'
  saveLink.style.left = '25px'
  saveLink.style.padding = '8px 12px'
  saveLink.style.zIndex = '10000000000'
  saveLink.style.textDecoration = 'underline'
  saveLink.append(document.createTextNode('Save URL'))

  document.querySelector('#wm-ipp-base').after(saveLink)
})