QQ 空间网页版一键清空小黑屋:油猴脚本
不说了,直接贴上脚本代码:
js
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 2025-05-27
// @description try to take over the world!
// @author You
// @match https://user.qzone.qq.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=qq.com
// @grant none
// ==/UserScript==
(function() {
'use strict';
const button = document.createElement('button');
button.textContent = 'Clear All';
button.setAttribute('onclick','const iframes=document.querySelectorAll("iframe");iframes.forEach(e=>{const c=e.contentDocument||e.contentWindow.document,o=c.querySelectorAll("#hideUinContainer > li > a > span.close");o.forEach(e=>{e.focus(),e.click()})});')
setInterval(() => {
const container = document.querySelector('body > div.ui-popup.ui-popup-modal.ui-popup-show.ui-popup-focus > div > div > div.ui-dl-hd > div > div.qz-main');
if (container && !container.querySelector('button')) {
container.appendChild(button);
}
console.log(container,"gjufd",button)
}, 2000);
})();
- Total words: 99 -
Read other posts