Pornolab image preview

Lets you preview torrents first image by showing on hover on the tracker listing

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Pornolab image preview
// @description  Lets you preview torrents first image by showing on hover on the tracker listing
// @namespace    https://pornolab.net/forum/index.php
// @version      0.1
// @description  try to take over the world!
// @author       tobij12
// @match        https://pornolab.net/forum/tracker.php*
// @require      https://cdn.jsdelivr.net/npm/[email protected]/dist/axios.min.js
// @grant        GM_xmlhttpRequest
// ==/UserScript==

(function() {
    'use strict';
    let links = window.document.querySelectorAll('.med .tLink');

    links.forEach((el) => {
        el.opened = false
        el.onmouseenter = function() {
            el.opened = true

            axios.get(el.href).then(function(res) {
                if (el.opened !== true) {
                    return ;
                }
                let div = document.createElement('div');
                div.innerHTML = res.data;
                let source = div.querySelector('var.postImg').title;
                let img = document.createElement('img');

                img.src = source;
                img.classList.add('appendedHoverIMg');
                img.style = 'position: absolute; left: 350px; margin-top: 25px; width: auto; height: 700px';

                el.appendChild(img);
                el.style.textDecoration = 'underline';
          });
        };

        el.onmouseout = function() {
            el.opened = false
            const node = el.querySelector('.appendedHoverIMg');
            if (node !== null) {
                node.remove();
            }
        }
    });
})();