Jump to Web Archives

Adds menu commands to jump to Wayback Machine, TimeTravel, and Archive.is versions of current page

目前为 2025-03-07 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Jump to Web Archives
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2.2
  5. // @description Adds menu commands to jump to Wayback Machine, TimeTravel, and Archive.is versions of current page
  6. // @author aspen138
  7. // @match *://*
  8. // @match *://*/*
  9. // @icon https://web-static.archive.org/_static/images/archive.ico
  10. // @grant GM_registerMenuCommand
  11. // @grant window.open
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. // Get current URL and year for all functions
  18. const currentUrl = window.location.href;
  19. const currentYear = new Date().getFullYear();
  20.  
  21. // Register Wayback Machine menu command
  22. GM_registerMenuCommand('Jump to Wayback Machine', function() {
  23. const waybackUrl = `https://web.archive.org/web/${currentYear}0000000000*/` + currentUrl;
  24. window.location.href = waybackUrl;
  25. }, 'w');
  26.  
  27. // Register TimeTravel menu command
  28. GM_registerMenuCommand('Jump to TimeTravel Archive', function() {
  29. const timeTravelUrl = `http://timetravel.mementoweb.org/list/${currentYear}0715151719/` + currentUrl;
  30. window.location.href = timeTravelUrl;
  31. }, 't');
  32.  
  33. // Register Archive.is menu command
  34. GM_registerMenuCommand('Jump to Archive.is', function() {
  35. const archiveIsUrl = `https://archive.is/` + currentUrl;
  36. window.location.href = archiveIsUrl;
  37. }, 'i');
  38.  
  39.  
  40. // Register Archive.md menu command
  41. GM_registerMenuCommand('Jump to Archive.md', function() {
  42. const archiveIsUrl = `https://archive.md/` + currentUrl;
  43. window.location.href = archiveIsUrl;
  44. }, 'i');
  45.  
  46.  
  47. // Register Open All menu command
  48. GM_registerMenuCommand('Open All Archives', function() {
  49. const waybackUrl = `https://web.archive.org/web/${currentYear}0000000000*/` + currentUrl;
  50. const timeTravelUrl = `http://timetravel.mementoweb.org/list/20120715151719/` + currentUrl;
  51. const archiveIsUrl = `https://archive.is/` + currentUrl;
  52. const archiveMdUrl = `https://archive.md/` + currentUrl;
  53.  
  54. window.open(waybackUrl, '_blank');
  55. window.open(timeTravelUrl, '_blank');
  56. window.open(archiveIsUrl, '_blank');
  57. window.open(archiveMdUrl, '_blank');
  58. }, 'a');
  59. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址