tmp2.js 946 B

123456789101112131415161718192021222324252627282930313233343536
  1. // ==UserScript==
  2. // @name T-askai-清空对话
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description try to take over the world!
  6. // @require https://web.tianyunperfect.cn/simple/js/util.js
  7. // @author You
  8. // @match https://askchat.ai/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=askchat.ai
  10. // ==/UserScript==
  11. (async () => {
  12. 'use strict';
  13. // Your code here...
  14. unsafeWindow.confirm = () => {
  15. return 1
  16. };
  17. console.log("T-askai-清空对话");
  18. // 查找id以chat开头的a标签
  19. let a = await getDom("a[id^='chat']");
  20. console.log(a);
  21. // 点击a标签
  22. if (a) {
  23. // 在a里查找onclick 以del开头的btn
  24. let btn = a.querySelector("button[onclick^='del']");
  25. console.log(btn);
  26. if (btn) {
  27. // 点击btn
  28. btn.click();
  29. }
  30. }
  31. })();