OPGG去底部遮挡

OPGG底部元素遮挡remove

// ==UserScript==
// @name         OPGG去底部遮挡
// @namespace    http://tampermonkey.net/
// @version      2025-01-10
// @description  OPGG底部元素遮挡remove
// @license      Copyright © 2025 Leon. All rights reserved.
// @author       Leon
// @match        https://*.op.gg/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=op.gg
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    let timer = setInterval(() => {
       const picSrc = 'https://www.gstatic.com/images/icons/material/system/1x/warning_amber_24dp.png';

       let body = document.body;
       let allElements = body.querySelectorAll('*');

       allElements.forEach(element => {
           
           if (element.tagName.toLowerCase() === 'img' && element.src === picSrc) {
               removeGrandparent(element);
               // clearInterval(timer);

           }
       });

       function removeGrandparent(element) {
           if (element?.parentNode?.parentNode) {
               element.parentNode.parentNode.remove();
           }
       }
   }, 1000);
})();