Image File Viewer

open image file with viewer.min.js

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Image File Viewer
// @namespace    https://greasyfork.org/zh-CN/scripts/418823-image-file-viewer
// @version      0.2
// @description  open image file with viewer.min.js
// @description:zh  用viewer.min.js打开图片(本地,网络)
// @match             *://*/*.jpg
// @match             *://*/*.png
// @grant        GM_addStyle
// @require    https://cdnjs.cloudflare.com/ajax/libs/viewerjs/1.8.0/viewer.min.js
// @license MIT
// ==/UserScript==

(function(){
    GM_addStyle("body{overflow: hidden}");

    var link = document.createElement("link");
    link.rel = "stylesheet";
    link.type = "text/css";
    link.href = "https://cdnjs.cloudflare.com/ajax/libs/viewerjs/1.8.0/viewer.min.css";
    document.getElementsByTagName("head")[0].appendChild(link);

    var img = document.getElementsByTagName('img');
    if(img.length === 0) return;
    img[0].hidden = true;

    const viewer = new Viewer(img[0], {
        inline: true,
      button:false,
      tooltip:false,
        backdrop: false,
        toolbar: {
            zoomIn: 4,
            zoomOut: 4,
            oneToOne: 4,
            reset: 4,
            prev: 0,
            play: {
                show: 0,
                size: 'large',
            },
            next: 0,
            rotateLeft: 4,
            rotateRight: 4,
            flipHorizontal: 4,
            flipVertical: 4,
        },
        title: 0,
        navbar: 0,
        //    minWidth: ,
        //    minHeight: ,
        viewed() {
        },
    });
})();