|
|
屏蔽雪花特效
- // ==UserScript==
- // @name 屏蔽雪花
- // @version 0.1
- // @author M
- // @match https://www.gamemale.com/*
- // @run-at document-start
- // ==/UserScript==
- (function() {
- 'use strict';
- const originalSetInterval = window.setInterval;
- window.setInterval = function(callback, interval) {
- if (interval === 300) {
- return originalSetInterval.call(window, function() {}, 86400000);
- }
- return originalSetInterval.call(window, callback, interval);
- };
- const style = document.createElement('style');
- style.textContent = '.viewui-snowflake-section{visibility:hidden!important;height:0!important;overflow:hidden!important;pointer-events:none!important}';
- document.head.appendChild(style);
- const observer = new MutationObserver(function(mutations) {
- for (let i = 0; i < mutations.length; i++) {
- const addedNodes = mutations[i].addedNodes;
- for (let j = 0; j < addedNodes.length; j++) {
- const node = addedNodes[j];
- if (node.classList && node.classList.contains('viewui-snowflake-snow')) {
- node.parentNode && node.parentNode.removeChild(node);
- return;
- }
- }
- }
- });
- if (document.readyState === 'loading') {
- document.addEventListener('DOMContentLoaded', function() {
- observer.observe(document.body, {childList: true, subtree: true});
- });
- } else {
- observer.observe(document.body, {childList: true, subtree: true});
- }
- })();
复制代码
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
评分
-
查看全部评分
|