楼主
众所周知,现在linux.sb每一次发帖都会弹窗“本站严禁发布以下内容”,非常烦人。所以我做了这个。
油猴使用。
// ==UserScript==
// @name linux.sb隐藏并自动确认发帖时的规范弹窗
// @namespace http://tampermonkey.net/
// @version 1.0
// @description RT
// @author Altzin
// @match *://linux.sb/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
const style = document.createElement('style');
style.textContent = `
.posting-notice-backdrop {
display: none !important;
}
`;
document.head.appendChild(style);
function clickConfirmButton() {
const confirmBtn = document.querySelector('.posting-notice-confirm');
if (confirmBtn) {
confirmBtn.click();
}
}
clickConfirmButton();
const observer = new MutationObserver(function(mutations) {
const confirmBtn = document.querySelector('.posting-notice-confirm');
if (confirmBtn) {
confirmBtn.click();
}
});
observer.observe(document.body, {
childList: true,
subtree: true
});
setInterval(clickConfirmButton, 2000);
})();