您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
This script hides the alert "UsingAdBlock" that is shown when you use an ad-block.
当前为
// ==UserScript== // @name QuiFinanza: Hide the "UsingAdBlock" alert // @name:it QuiFinanza: Nasconde l'avviso "UsingAdBlock" // @description This script hides the alert "UsingAdBlock" that is shown when you use an ad-block. // @description:it Questo script nasconde l'alert "UsingAdBlock" che viene visualizzato quando si usa un ad-block. // @match https://*.quifinanza.it/* // @grant none //// @run-at document-start // @version 1.0.2 // @author Cyrano68 // @license MIT // @namespace https://gf.qytechs.cn/users/788550 // ==/UserScript== (function() { "use strict"; function console_log(text) { //let now = new Date().toISOString(); let now = new Date().toLocaleString(); console.log(`${now} ${text}`); } console_log("==> QuiFinanza_HideUsingAdBlockAlert: HELLO! Loading script..."); document.addEventListener("DOMContentLoaded", onDOMContentLoaded); window.addEventListener("load", onWindowLoaded); createMutationObserver(); function onDOMContentLoaded() { console_log(`==> QuiFinanza_HideUsingAdBlockAlert: onDOMContentLoaded - document.readyState=${document.readyState}`); // DO NOTHING! } function onWindowLoaded() { console_log(`==> QuiFinanza_HideUsingAdBlockAlert: onWindowLoaded - document.readyState=${document.readyState}`); // DO NOTHING! } function onMutationList(mutationList, observer) { //console_log(`==> QuiFinanza_HideUsingAdBlockAlert: onMutationList - mutationList.length=${mutationList.length}`); mutationList.forEach((mutation, i) => { //console_log(`==> QuiFinanza_HideUsingAdBlockAlert: onMutationList - mutation[${i}] - mutation.type=${mutation.type}`); if (mutation.type === "childList") { let addedNodes = mutation.addedNodes; if (addedNodes.length > 0) { //console_log(`==> QuiFinanza_HideUsingAdBlockAlert: onMutationList - mutation[${i}] - addedNodes.length=${addedNodes.length}`); addedNodes.forEach((addedNode, j) => { let searchedDiv = searchVisibleNode(addedNode, "div.fc-dialog-container"); if (searchedDiv !== null) { //console_log(`==> QuiFinanza_HideUsingAdBlockAlert: onMutationList - searchedDiv.outerHTML='${searchedDiv.outerHTML}'`); let parentElement = searchedDiv.parentElement; console_log(`==> QuiFinanza_HideUsingAdBlockAlert: onMutationList - parentElement='${parentElement}'`); searchedDiv.style.display = "none"; // Hide node. document.body.style.overflowY = "scroll"; // Show vertical scrollbar. searchedDiv.remove(); // Remove node. IMPORTANT: Without this instruction the script does NOT work properly. console_log(`==> QuiFinanza_HideUsingAdBlockAlert: onMutationList - 'fc-dialog-container' - mutation[${i}], addedNode[${j}] - searchedDiv.tagName='${searchedDiv.tagName}', searchedDiv.classList='${searchedDiv.classList}' ---> HIDDEN/REMOVED`); } /** let searchedDiv2 = searchVisibleNode(addedNode, "div#iol_player_container"); if (searchedDiv2 !== null) { // We also hide another popup appearing on the bottom-right of the page. // //console_log(`==> QuiFinanza_HideUsingAdBlockAlert: onMutationList - searchedDiv2.outerHTML='${searchedDiv2.outerHTML}'`); let parentElement = searchedDiv2.parentElement; console_log(`==> QuiFinanza_HideUsingAdBlockAlert: onMutationList - parentElement='${parentElement}'`); searchedDiv2.style.display = "none"; // Hide node. document.body.style.overflowY = "scroll"; // Show vertical scrollbar. searchedDiv2.remove(); // Remove node. IMPORTANT: Without this instruction the script does NOT work properly. console_log(`==> QuiFinanza_HideUsingAdBlockAlert: onMutationList - 'iol_player_container' - mutation[${i}], addedNode[${j}] - searchedDiv2.tagName='${searchedDiv2.tagName}', searchedDiv2.classList='${searchedDiv2.classList}' ---> HIDDEN/REMOVED`); } /**/ }); } } }); } function searchVisibleNode(node, selector) { let parentElement = node.parentElement; return (parentElement === null ? null : parentElement.querySelector(`${selector}:not([style*=\"display:none\"]):not([style*=\"display: none\"])`)); } function createMutationObserver() { console_log("==> QuiFinanza_HideUsingAdBlockAlert: createMutationObserver"); // SEE: https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver const MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; // Create an observer instance linked to the callback function. const observer = new MutationObserver(onMutationList); // Options for the observer (which mutations to observe). const config = {subtree: true, childList: true}; // Start observing the target node for configured mutations. observer.observe(document, config); } console_log("==> QuiFinanza_HideUsingAdBlockAlert: Script loaded"); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址