Web Archive Save Link

Adds a save button to web archive pages.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==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)
})