转载请注明出处,如有问题请联系我们! ChatGPT镜像站简易辅助(删除时帮点确定并定位输入框)【ChatGPT帮写的油猴脚本】

功能:就是点击删除对话的时候,自动点击“确定”,并定位到下方的输入框

我不会JS,是ChatGPT帮我写的,如果要添加新功能,或者修改,请复制代码后让AI帮改。功能很简单,也没什么技术含量,但在我使用ChatGPT时,确实能帮我节省一些时间和精力,感觉挺好用,所以分享给兄弟们

不会用脚本的兄弟,看这里的教程。

适用于以下界面的镜像站

 

 

[JavaScript] 纯文本查看 复制代码
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// ==UserScript==
// @name         删除后自动点击“确定”,并定位到输入框
// @namespace    [url=http://www.52pojie.cn/thread-1847004-1-1.html]www.52pojie.cn/thread-1847004-1-1.html[/url]
// @version      1.0
// @description  删除后自动点击“确定”,并定位到输入框
// @AuThor       wkdxz @ 52pojie.cn
// @match        *://*/*
// @grant        none
// ==/UserScript==
 
(function() {
    'use strict';
 
    // 定时器,每500毫秒检查
    setInterval(function(){
        const xpath = "/html/body/div[3]/div/div/div[1]/div/div[2]/button[2]/span";
        const button = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
 
        if(button){
            button.click();
        }
       
        // 定位到输入框
        const textarea = document.evaluate('//*[@id="app"]/div/div[1]/div/div/div/div/div/div/footer/div/div[3]/div/div[1]/div[1]/textarea', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
        if (textarea) {
            textarea.focus();
        }
       
    }, 500);
  })();


标签 ChatGPT

免登录评论