Greasy Fork is available in English.
删除不太灵的VIP查看限制和模糊效果
当前为
// ==UserScript==
// @name 不太灵VIP
// @namespace http://tampermonkey.net/
// @version 1.0
// @description 删除不太灵的VIP查看限制和模糊效果
// @author kkzh
// @match https://www.2bt0.com/*
// @match file:///*影视管理系统.html*
// @grant none
// @run-at document-end
// @license MIT
// ==/UserScript==
(function() {
'use strict';
// 等待页面加载完成
function waitForElement(selector, callback, maxAttempts = 50) {
let attempts = 0;
const interval = setInterval(() => {
const element = document.querySelector(selector);
if (element || attempts >= maxAttempts) {
clearInterval(interval);
if (element) {
callback(element);
}
}
attempts++;
}, 100);
}
// 删除模糊效果的函数
function removeBlurEffect() {
// 查找包含模糊效果的div元素
const blurredElements = document.querySelectorAll('div[style*="filter: blur(5px)"]');
blurredElements.forEach(element => {
// 移除模糊相关的样式
element.style.filter = '';
element.style.opacity = '';
element.style.pointerEvents = '';
element.style.userSelect = '';
console.log('已移除模糊效果');
});
}
// 删除VIP提示容器的函数
function removeVipNotice() {
// 查找包含"资源区域仅VIP可查看"文本的元素
const vipNotices = document.querySelectorAll('h3');
vipNotices.forEach(h3 => {
if (h3.textContent.includes('资源区域仅VIP可查看')) {
// 找到包含VIP提示的最外层容器
let container = h3;
while (container.parentElement) {
const parent = container.parentElement;
// 查找具有绝对定位和高z-index的容器
const style = window.getComputedStyle(parent);
if (style.position === 'absolute' && parseInt(style.zIndex) >= 100) {
container = parent;
break;
}
container = parent;
// 防止无限循环,如果到达body就停止
if (parent.tagName === 'BODY') break;
}
// 删除整个VIP提示容器
if (container && container !== document.body) {
container.remove();
console.log('已删除VIP提示容器');
}
}
});
}
// 主执行函数
function removeRestrictions() {
removeBlurEffect();
removeVipNotice();
}
// 页面加载完成后执行
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', removeRestrictions);
} else {
removeRestrictions();
}
// 监听DOM变化,处理动态加载的内容
const observer = new MutationObserver((mutations) => {
let shouldCheck = false;
mutations.forEach((mutation) => {
if (mutation.type === 'childList' && mutation.addedNodes.length > 0) {
shouldCheck = true;
}
});
if (shouldCheck) {
setTimeout(removeRestrictions, 500);
}
});
// 开始观察DOM变化
observer.observe(document.body, {
childList: true,
subtree: true
});
// 定期检查(备用方案)
setInterval(removeRestrictions, 2000);
console.log('影视管理系统VIP限制移除脚本已加载');
})();