// ==UserScript== // @name coze // @namespace https://www.coze.com/ // @version 2024-05-19 // @description try to take over the world! // @author wxq // @match https://www.coze.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net // @grant none // ==/UserScript== (function() { // Your code here... var find_time = 0; var regex = /\/space\/[^/]+\/bot\/[^/]+/ var coze_timer = null; function log(msg) { console.log("coze",msg); } function hideFirstChild(classid,fn) { var parentElement = document.querySelector(classid); // 获取class为semi-spin-children的第一个元素 if(!parentElement) { log(classid+" not find parent ") return; } var firstChild = parentElement.firstElementChild; // 获取该元素的第一个子元素 if(!firstChild) { log(classid+" not find firstChild ") return; } firstChild.style.display = 'none'; if(typeof fn == "function") { fn(); } return true; } function containerCb() { var el = document.querySelector(".sidesheet-container"); el.style.display = "block" var firstChild = el.firstElementChild; let rnd_cls = firstChild.className; log(rnd_cls) let nodes = document.getElementsByClassName(rnd_cls); log(nodes.length) nodes.forEach(v=> { v.style.display = 'none'; }) } function doHide(){ if(!regex.test(location.href)) { log("url not match") return; } if(!hideFirstChild(".sidesheet-container",containerCb)) { return; } if(!hideFirstChild(".semi-spin-children")) { return; } log('do set') clearInterval(coze_timer) } coze_timer = setInterval(doHide,1000) })();