Empornium show hidden thumbnail blocks

Automatically expands all "Show" blocks with images.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name             Empornium show hidden thumbnail blocks
// @version          1.1.0
// @description      Automatically expands all "Show" blocks with images.
// @namespace        https://greasyfork.org/users/241444
// @author           salad: https://greasyfork.org/en/users/241444-salad
// @license          GPL-3.0-only
// @match            https://www.empornium.is/torrents.php?id=*
// @match            https://www.empornium.sx/torrents.php?id=*
// @icon             https://www.google.com/s2/favicons?domain=empornium.is
// ==/UserScript==

(() => {

  const hiddenBlocks = document.querySelectorAll('.spoiler.hidden');
  let revealedImages = 0;

  hiddenBlocks.forEach(block => {
    const images = block.querySelectorAll('img');
    if (images.length) {
      images.forEach(img => {
        img.src = img.dataset.src;
        revealedImages++;
      });

      block.classList.remove('hidden');
    }
  });

  console.info('Revealed %d hidden blocks with %d images.', hiddenBlocks.length, revealedImages);

})();