fix: chatgpt ask

This commit is contained in:
lencx
2024-09-16 20:08:33 +08:00
parent ac138e5285
commit ad7cd1cbae
5 changed files with 11 additions and 6 deletions

View File

@@ -101,7 +101,7 @@ Learn more: [electronjs/doc](https://www.electronjs.org/docs/latest/api/extensio
<!-- EXTENSIONS_START -->
| Name | Version | Description |
| --- | --- | --- |
| [@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](https://github.com/lencx/Noi/tree/main/extensions/noi-ask) | 0.1.11 | 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. |

View File

@@ -9,7 +9,7 @@ Learn more: [electronjs/doc](https://www.electronjs.org/docs/latest/api/extensio
<!-- EXTENSIONS_START -->
| Name | Version | Description |
| --- | --- | --- |
| [@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](https://github.com/lencx/Noi/tree/main/extensions/noi-ask) | 0.1.11 | 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. |

View File

@@ -54,8 +54,13 @@ class OpenAIAsk extends NoiAsk {
const inputElement = document.querySelector('form #prompt-textarea');
if (inputElement) {
inputElement.focus();
inputElement.innerHTML = '';
document.execCommand('insertText', false, message);
inputElement.innerHTML = ''; // Clear existing content
const lines = message.split('\n');
lines.forEach(line => {
const p = document.createElement('p');
p.textContent = line; // Use textContent to prevent HTML injection
inputElement.appendChild(p);
});
}
}
}

View File

@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "@noi/ask",
"version": "0.1.9",
"version": "0.1.11",
"homepage": "https://github.com/lencx/Noi/tree/main/extensions/noi-ask",
"description": "The best assistant for batch asking and quick typing of prompts.",
"content_scripts": [

View File

@@ -5,7 +5,7 @@
{
"name": "@noi/ask",
"description": "The best assistant for batch asking and quick typing of prompts.",
"version": "0.1.10",
"version": "0.1.11",
"url": "https://github.com/lencx/Noi/tree/main/extensions/noi-ask",
"dirname": "noi-ask",
"disabled": false