Open yangxuangui1117 opened 1 month ago
我也有同样的问题,很急切地期望能新版本或者有别的方法临时解决 @lencx
lencx给了答复: 是 openai 的域名改成 chatgpt.com 了,导致之前的脚本失效了 我已经修改了,你重新更新一下扩展,如何更新扩展之前写过教程。
但目前只有gpt-4o单独用的时候可以同步prompt,多个AI一起用还是无法同步prompt到gpt-4o的输入框
单用
多个AI一起用
I am a beginner with JavaScript and this application, but I was able to resolve the issue by overriding main.js
.
manifest.json
.我是一个JavaScript和这个应用程序的初学者,但我通过覆盖main.js解决了这个问题。
它可以与多个AI一起使用。 你还需要编辑侧边栏和manifest.json中的URL。
class OpenAIAsk extends NoiAsk {
static name = 'ChatGPT';
static url = 'https://chatgpt.com';
static sync(message) {
const inputElement = document.querySelector('textarea#prompt-textarea');
if (inputElement) {
const nativeTextareaSetter = Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype, 'value').set;
nativeTextareaSetter.call(inputElement, message);
const inputEvent = new InputEvent('input', {
bubbles: true,
cancelable: true,
});
inputElement.dispatchEvent(inputEvent);
}
}
static autoFocus() {
const inputElement = document.querySelector('textarea#prompt-textarea');
if (inputElement) {
inputElement.focus();
}
}
static submit() {
const btn = document.querySelector('button[data-testid="fruitjuice-send-button"]');
if (btn) this.autoClick(btn);
}
}
lencx给了答复: 是 openai 的域名改成 chatgpt.com 了,导致这个密钥脚本失效了 我已经修改了,你重新更新一下扩展,如何更新扩展之前写过教程。
- 查看插件教程:https://mp.weixin.qq.com/s/M6gO6MdK5obCvs2LIBZA3w
- 修改扩展代码:https://github.com/lencx/Noi/tree/main/extensions/noi-ask
- 编辑侧栏 ChatGPT 链接为https://chatgpt.com
解决了非常感谢
Thanks to @hayashitomoharu and @neo-ai-zh for the guidance.
For my solution, it was simply about changing the URL in the sidebar, manifest.json, and main.js (no actual code changes required).
Click on the three dots next to ChatGPT in the Sidebar => Edit => change the URL to https://chatgpt.com/.
In both manifest.json and main.js => update the URL from https://chat.openai.com to https://chatgpt.com/.
My OpenAIAsk class still looks like this:
class OpenAIAsk extends NoiAsk {
static name = 'ChatGPT';
static url = 'https://chatgpt.com';
static submit() {
const btn = document.querySelector('button[data-testid="send-button"]');
if (btn) this.autoClick(btn);
}
}
I am a beginner with JavaScript and this application, but I was able to resolve the issue by overriding .
main.js
- It can be used with multiple AIs.
- You also need to edit the URL in the sidebar and .
manifest.json
I'm a beginner in JavaScript and this app, but I solved this problem by overlaying main.js.
It can be used with multiple AIs. You'll also need to edit the URLs in the sidebar and manifest.json.
class OpenAIAsk extends NoiAsk { static name = 'ChatGPT'; static url = 'https://chatgpt.com'; static sync(message) { const inputElement = document.querySelector('textarea#prompt-textarea'); if (inputElement) { const nativeTextareaSetter = Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype, 'value').set; nativeTextareaSetter.call(inputElement, message); const inputEvent = new InputEvent('input', { bubbles: true, cancelable: true, }); inputElement.dispatchEvent(inputEvent); } } static autoFocus() { const inputElement = document.querySelector('textarea#prompt-textarea'); if (inputElement) { inputElement.focus(); } } static submit() { const btn = document.querySelector('button[data-testid="fruitjuice-send-button"]'); if (btn) this.autoClick(btn); } }
I am a beginner with JavaScript and this application, but I was able to resolve the issue by overriding .
main.js
- It can be used with multiple AIs.
- You also need to edit the URL in the sidebar and .
manifest.json
I'm a beginner in JavaScript and this app, but I solved this problem by overlaying main.js.
It can be used with multiple AIs. You'll also need to edit the URLs in the sidebar and manifest.json.
class OpenAIAsk extends NoiAsk { static name = 'ChatGPT'; static url = 'https://chatgpt.com'; static sync(message) { const inputElement = document.querySelector('textarea#prompt-textarea'); if (inputElement) { const nativeTextareaSetter = Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype, 'value').set; nativeTextareaSetter.call(inputElement, message); const inputEvent = new InputEvent('input', { bubbles: true, cancelable: true, }); inputElement.dispatchEvent(inputEvent); } } static autoFocus() { const inputElement = document.querySelector('textarea#prompt-textarea'); if (inputElement) { inputElement.focus(); } } static submit() { const btn = document.querySelector('button[data-testid="fruitjuice-send-button"]'); if (btn) this.autoClick(btn); } }
You're on the right path, here's my quick-workaround (without using the custom ask mode). Easy for even non-developers to apply:
win11 noi0.4.0 noi ask模式,gpt-4o 无法同步发送prompt![20240528-211857](https://github.com/lencx/Noi/assets/156068829/a6b05eb8-32e6-44f9-92ba-313f3549113d)