web.archive.org查询

在web.archive.org的URLs中查询当前网址,因为部分网址有一些个性化后缀,比如b站的vd_source

  1. // ==UserScript==
  2. // @name web.archive.org查询
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  5. // @description 在web.archive.org的URLs中查询当前网址,因为部分网址有一些个性化后缀,比如b站的vd_source
  6. // @author You
  7. // @match https://www.bilibili.com/video/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=bilibili.com
  9. // @grant none
  10. // @license GPL-3.0 License
  11. // ==/UserScript==
  12.  
  13. setTimeout(add_button, 2000);
  14.  
  15. function add_button() {
  16. 'use strict';
  17. add_container();
  18.  
  19. var button1 = document.createElement("button");
  20. button1.textContent = "web.archive.org_urls";
  21. button1.style.display = "block";
  22. button1.style.fontSize = "1rem";
  23. button1.title = ""
  24.  
  25. button1.onclick = function () {
  26. window.open('https://web.archive.org/web/*/'+location.href+'*');
  27. return;
  28. };
  29. background_color(button1);
  30.  
  31. ///////////
  32.  
  33. var contain_ = document.querySelector("#container")
  34. contain_.appendChild(button1);
  35. }
  36.  
  37. function add_container() {
  38. let Container = document.createElement('div');
  39. Container.id = "container";
  40. Container.style.position = "fixed";
  41. Container.style.right = "150px";
  42. Container.style.top = "300px";
  43. document.body.appendChild(Container);
  44. }
  45.  
  46. function background_color(button) {
  47. button.onmouseover = function () {
  48. this.style.backgroundColor = 'cyan';
  49. };
  50. button.onmouseout = function () {
  51. this.style.backgroundColor = 'transparent';
  52. };
  53. }