修复3dm论坛图片遮挡bug

隐藏 bbs.3dmgame.com 网页上的class为pct的div内的img元素

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         修复3dm论坛图片遮挡bug
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  隐藏 bbs.3dmgame.com 网页上的class为pct的div内的img元素
// @author       You
// @match        *://bbs.3dmgame.com/*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // Function to remove img elements inside divs with class "pct"
    function hideImagesInPctDivs() {
        // Select all div elements with the class "pct"
        var pctDivs = document.querySelectorAll('div.pct');

        // Iterate over the NodeList of divs and remove img child elements
        pctDivs.forEach(function(div) {
            // Select all img elements that are children of the current div
            var images = div.querySelectorAll('img');
            // Convert NodeList to Array and remove each img element
            Array.from(images).forEach(function(img) {
                img.remove();
            });
        });
    }

    // Run the function once when the script loads
    hideImagesInPctDivs();

    // Optionally, if you want to handle dynamic content loaded after page load,
    // you can set up a MutationObserver or use events like DOMSubtreeModified.
})();