diff --git a/README.md b/README.md index 1c92a99..2fc61aa 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ Learn more: [electronjs/doc](https://www.electronjs.org/docs/latest/api/extensio | Name | Version | Description | | --- | --- | --- | -| [@noi/ask](https://github.com/lencx/Noi/tree/main/extensions/noi-ask) | 0.1.9 | The best assistant for batch asking and quick typing of prompts. | +| [@noi/ask](https://github.com/lencx/Noi/tree/main/extensions/noi-ask) | 0.1.10 | The best assistant for batch asking and quick typing of prompts. | | [@noi/ask-custom](https://github.com/lencx/Noi/tree/main/extensions/noi-ask-custom) | 0.1.0 | The best assistant for batch asking and quick typing of prompts. | | [@noi/export-chatgpt](https://github.com/lencx/Noi/tree/main/extensions/noi-export-chatgpt) | 0.1.1 | ChatGPT chat history export, supports PDF, Image, and Markdown formats. | | [@noi/reset](https://github.com/lencx/Noi/tree/main/extensions/noi-reset) | 0.1.3 | Reset certain website styles to enhance compatibility with Noi. | diff --git a/extensions/README.md b/extensions/README.md index 8c0d3db..dd1e07b 100644 --- a/extensions/README.md +++ b/extensions/README.md @@ -9,7 +9,7 @@ Learn more: [electronjs/doc](https://www.electronjs.org/docs/latest/api/extensio | Name | Version | Description | | --- | --- | --- | -| [@noi/ask](https://github.com/lencx/Noi/tree/main/extensions/noi-ask) | 0.1.9 | The best assistant for batch asking and quick typing of prompts. | +| [@noi/ask](https://github.com/lencx/Noi/tree/main/extensions/noi-ask) | 0.1.10 | The best assistant for batch asking and quick typing of prompts. | | [@noi/ask-custom](https://github.com/lencx/Noi/tree/main/extensions/noi-ask-custom) | 0.1.0 | The best assistant for batch asking and quick typing of prompts. | | [@noi/export-chatgpt](https://github.com/lencx/Noi/tree/main/extensions/noi-export-chatgpt) | 0.1.1 | ChatGPT chat history export, supports PDF, Image, and Markdown formats. | | [@noi/reset](https://github.com/lencx/Noi/tree/main/extensions/noi-reset) | 0.1.3 | Reset certain website styles to enhance compatibility with Noi. | diff --git a/extensions/noi-ask/main.js b/extensions/noi-ask/main.js index 42eb873..a2d9fd2 100644 --- a/extensions/noi-ask/main.js +++ b/extensions/noi-ask/main.js @@ -47,6 +47,19 @@ class OpenAIAsk extends NoiAsk { static name = 'ChatGPT'; static url = 'https://chatgpt.com'; + static sync(message) { + if (document.querySelector('form textarea')) { + this.sync(message); + } else { + const inputElement = document.querySelector('form #prompt-textarea'); + if (inputElement) { + inputElement.focus(); + inputElement.innerHTML = ''; + document.execCommand('insertText', false, message); + } + } + } + static submit() { const forms = document.querySelectorAll('main form'); const form = forms[forms.length - 1]; diff --git a/extensions/noi.extensions.json b/extensions/noi.extensions.json index 31f3d55..af8be17 100644 --- a/extensions/noi.extensions.json +++ b/extensions/noi.extensions.json @@ -5,7 +5,7 @@ { "name": "@noi/ask", "description": "The best assistant for batch asking and quick typing of prompts.", - "version": "0.1.9", + "version": "0.1.10", "url": "https://github.com/lencx/Noi/tree/main/extensions/noi-ask", "dirname": "noi-ask", "disabled": false @@ -29,7 +29,7 @@ { "name": "@noi/reset", "description": "Reset certain website styles to enhance compatibility with Noi.", - "version": "0.1.1", + "version": "0.1.3", "url": "https://github.com/lencx/Noi/tree/main/extensions/noi-reset", "dirname": "noi-reset", "disabled": false