Greasy Fork 还支持 简体中文。

Reddit image de-framer

Removes the frame from reddit images and replaces it with a minimalist image viewer.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name        Reddit image de-framer
// @namespace   Violentmonkey Scripts
// @match       https://www.reddit.com/media*
// @require     https://cdnjs.cloudflare.com/ajax/libs/viewerjs/1.11.7/viewer.js
// @resource    customCSS https://cdnjs.cloudflare.com/ajax/libs/viewerjs/1.11.7/viewer.css
// @grant       GM_getResourceText
// @grant       GM_addStyle
// @version     1.02
// @author      ape-that-presses-keys
// @license     MIT
// @description Removes the frame from reddit images and replaces it with a minimalist image viewer.
// ==/UserScript==

// add the image viewer source files to the page
var customCSS = GM_getResourceText("customCSS");
GM_addStyle(customCSS);

// replace the body with the elements needed for the image viewer
let image_url = document.querySelector("zoomable-img > img").src;
document.body.innerHTML = `
<div style="
    background-color: #282828;
    height: 100%;
    width: 100%;
    position: fixed;"
></div>
<div>
    <img id="image" src="${image_url}" alt="Picture">
</div>
`;

// setup and show the viewer
const viewer = new Viewer(document.getElementById('image'), {
    backdrop: false,
    button: false,
    navbar: false,
    title: false,
    toolbar: false,
    initialCoverage: 1.0,
    inline: false,
    rotatable: false,
    scalable: false,
    zoomable: true
});
viewer.show();

// image has been shown and viewed in the viewer
let i = document.querySelector("#image");
i.style.display = "none";