// ==UserScript==
// @name 网站屏蔽器
// @version 1.0.1
// @description 屏蔽整个网站
// @namespace PPPScript
// @license MIT
// @author PPP
// @include *
// @grant unsafeWindow
// @downloadURL none
// ==/UserScript==
function match() {
return localStorage.PPP_banned_sign == 'true';
}
function unmatch() {
return localStorage.PPP_unbanned_sign == 'true';
}
if(unmatch() === false) {
let hre = window.location.origin;
if(match() === true) {
let innerHtml = `
此网站已被屏蔽
取消屏蔽
此网站已被屏蔽
来自 PPP 创作的 网站屏蔽器。
`;
console.log(`PPP 创作的 网页屏蔽器 已自动屏蔽该网站:${window.location.origin}`);
let last = 1, now, countChange = -1, dangerLevels = [1000000, 100000, 10000, 3000, 1250, 500, 200, 100, 50, 25, 10, 5, 2, 1];
for(let i = now = setInterval(function() {}, 1); i > last; i--)
clearInterval(i), clearTimeout(i);
last = now;
setInterval(
function() {
if(document.documentElement.innerHTML != innerHtml) {
for(let i = now = setInterval(function() {}, 1); i > last; i--)
clearInterval(i), clearTimeout(i);
last = now, countChange++, document.documentElement.innerHTML = innerHtml;
if(countChange > dangerLevels[dangerLevels.length])
console.log(`请确认你的脚本没有问题。对抗次数已经达到 ${dangerLevels.pop()} 次。`);
}
}, 16
);
} else {
let innerHtml = `
屏蔽该网站
隐藏
`;
console.log(`PPP 创作的 网页屏蔽器 已开启`);
setInterval(
function() {
if(document.querySelector('PPP-banner') == null)
document.body.insertAdjacentHTML("beforeend", innerHtml);
}, 16
);
}
}