Skip to content

KeepChatGPT无法正常运行 #189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JadynWong opened this issue May 17, 2023 · 4 comments
Closed

KeepChatGPT无法正常运行 #189

JadynWong opened this issue May 17, 2023 · 4 comments
Labels
兼容问题 其它管理器可以运行,脚本猫不能运行

Comments

@JadynWong
Copy link

安装KeepChatGPT无法正常运行

检查异常发现 执行setInterval, fetch都会报此错误终止Uncaught TypeError: Illegal invocation.

image

手动编辑脚本, 改为unsafeWindow.setInterval, unsafeWindow.fetch可以正常运行.

使用Tampermonkey不进行任何运行更改, 运行正常.

@CodFrm CodFrm added the bug Something isn't working label May 17, 2023
@CodFrm
Copy link
Member

CodFrm commented May 17, 2023

这也许和我的沙盒实现有关系,在一些特定的网站上会出现这个问题,我编写了一个简单的脚本,在chatgpt上无法运行,但是在其它网站上可以运行。应该是chatgpt网站对这些方法进行了处理,导致了上下文丢失而产生这个问题。我会尝试在今天解决这个问题

// ==UserScript==
// @name         New Userscript
// @namespace    https://bbs.tampermonkey.net.cn/
// @version      0.1.0
// @description  try to take over the world!
// @author       You
// @match        https://chat.openai.com/?model=gpt-4
// @grant        unsafeWindow
// ==/UserScript==

(function () {
    'use strict';
    setInterval(() => {
        console.log('123');
    }, 1000);
    // Your code here...
})();

临时解决方案:

// ==UserScript==
// @name         New Userscript
// @namespace    https://bbs.tampermonkey.net.cn/
// @version      0.1.0
// @description  try to take over the world!
// @author       You
// @match        https://chat.openai.com/?model=gpt-4
// @grant        unsafeWindow
// ==/UserScript==

const setInterval = unsafeWindow.setInterval;

(function () {
    'use strict';
    setInterval(() => {
        console.log('123');
    }, 1000);
    // Your code here...
})();

@CodFrm CodFrm added 兼容问题 其它管理器可以运行,脚本猫不能运行 and removed bug Something isn't working labels May 17, 2023
CodFrm added a commit that referenced this issue May 17, 2023
@CodFrm
Copy link
Member

CodFrm commented May 17, 2023

修复

哥哥试一下这个版本:https://github.com/scriptscat/scriptcat/actions/runs/5003742572

近期准备把之前囤的issue都解决一下,然后再发下一个版本

@CodFrm CodFrm closed this as completed May 17, 2023
@JadynWong
Copy link
Author

感谢, 测试可用.

@CodFrm
Copy link
Member

CodFrm commented May 17, 2023

向着主流油猴扩展前进😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
兼容问题 其它管理器可以运行,脚本猫不能运行
Projects
None yet
Development

No branches or pull requests

2 participants