Wayback Machine - Image preView

Change <a>-tag to <img> in each img link

Tính đến 02-03-2024. Xem phiên bản mới nhất.

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

Bạn sẽ cần cài đặt một tiện ích mở rộng như Tampermonkey hoặc Violentmonkey để cài đặt kịch bản này.

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.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

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==
// @name         Wayback Machine - Image preView
// @description  Change <a>-tag to <img> in each img link
// @icon         https://play-lh.googleusercontent.com/hJnWYDQLRKqXZS7siQe-HeHZfcEFQ-cPS6cMNAKA4ukC5IwHgKHjQR8nWC9AUS-0kO-9
// @version      1.2
// @author       Ravlissimo
// @license      GPL-3.0 License
// @match        https://web.archive.org/*
// @require      https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js
// @require      https://update.greasyfork.org/scripts/488748/1336185/waitForKeyElements2.js
// @grant        GM_addStyle
// @namespace https://greasyfork.org/users/921216
// ==/UserScript==
/*
https://gist.github.com/Ravlissimo/6c49a9b975b1dfa8280bc4aa2823e5bf/raw/207bf5ec7f92cc533bf5195b1152153b261209f2/wayback-img-view.user.js
*/
var imageExtensions = ["gif", "png", "jpg", "jpeg"];
var imgExtRegex = new RegExp('.*\.(gif|png|jpg|jpeg)$', 'im');

/*-- Tune the CSS path, for each site, to only find links that can be
    the image links you care about.
*/
//-- For forums.hardwarezone.com.sg
var waitForKeyElements;
waitForKeyElements ("tr > td > a", delinkImage);

function delinkImage (jNode) {
    var imgUrl = jNode.attr ("href");

    if (imgExtRegex.test (imgUrl) ) {
        //-- Found an image link.  Replace contents.
        jNode.html ('<img src="' + imgUrl + '" class="gmDeLinked" alt="GM replaced image">');
    }
}

GM_addStyle ( "img.gmDeLinked { border: 1px solid lime; max-width: 60vw; };" );