Skip to content

Commit

Permalink
Release 0.11.0 (2023/10/18)
Browse files Browse the repository at this point in the history
  - Fix a bug due to ChatGPT layout structure changes.
  • Loading branch information
doggy8088 committed Oct 18, 2023
1 parent effc7dd commit 76efb88
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

- 0.11.0 (2023/10/18)

- Fix a bug due to ChatGPT layout structure changes.

- 0.10.0 (2023/09/1)

- Fix a bug due to ChatGPT layout structure changes on August 3, 2023 updates.
Expand Down
4 changes: 2 additions & 2 deletions PUBLISH.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Pubilsh Notes

1. Simply zip whole folder as a zip file such as `ChatGPTToolkitExtension_v0.10.0.zip`
1. Simply zip whole folder as a zip file such as `ChatGPTToolkitExtension_v0.11.0.zip`

```sh
7z a ChatGPTToolkitExtension_v0.10.0.zip _locales images scripts CHANGELOG.md manifest.json README.md
7z a ChatGPTToolkitExtension_v0.11.0.zip _locales images scripts CHANGELOG.md manifest.json README.md
```

2. Publish to Chrome Web Store.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ChatGPT 萬能工具箱提供 ChatGPT 網站一些好用的額外功能,可以

1. 自動從 URL 填入提示:這可以讓你把常用的提示詞(Prompt)透過「書籤」的方式保存下來,並在需要的時候可以快速填入。
2. 在 ChatGPT 回應的地方出現自動提示按鈕,這些常用的提示詞可以透過按鈕自動輸入。
3. 在 ChatGPT 已經提問的文字上按下滑鼠左鍵兩下,可以直接編輯提示詞。
3. 在 ChatGPT 已經提問的文字左側的使用者頭像上按滑鼠左鍵兩下,可以直接編輯提示詞。

以後會陸續推出好用功能,歡迎大家提供想法與建議。

Expand Down Expand Up @@ -54,7 +54,7 @@ The ChatGPT Toolbox provides some useful additional features for the ChatGPT web
1. Automatic prompt filling from URL: This allows you to save commonly used prompts as bookmarks and quickly fill them in when needed.
2. Automatic prompt buttons in the ChatGPT response. These commonly used prompts can be automatically entered through a button.
3. You can directly edit the prompt by double-clicking on the prompt text that has already been submitted.
3. You can directly edit the prompt by double-clicking on the user icon of the left side of the user's prompt text.
More useful features will be launched in the future, and everyone is welcome to provide ideas and suggestions.
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "__MSG_chatgpttoolkit_name__",
"description": "__MSG_chatgpttoolkit_description__",
"version": "0.10.0",
"version": "0.11.0",
"default_locale": "zh_TW",
"author": "__MSG_chatgpttoolkit_author__",
"icons": {
Expand Down
22 changes: 16 additions & 6 deletions scripts/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,24 @@
if (document.getElementsByTagName('main').length > 0) {
// 由於在切換歷史紀錄時會重建 main 元素,所以要監聽 document.body 的事件
document.body.addEventListener('dblclick', (event) => {
// 提示的 DOM 都套用 empty:hidden 這個類別
if (event.target.className == 'empty:hidden') {
// 使用者提示文字的圖示是 IMG,且 alt 屬性為 User
if (event.target.nodeName === 'IMG' && event.target.alt === 'User') {
// 由於 ChatGPT 網站上的 DOM 都沒有定位點,所以只能靠 SVG 的線條來決定是哪一個按鈕
// 底下這個線條是編輯按鈕的「鉛筆」圖示
let svg = event.target.parentElement.parentElement.parentElement.querySelector('path[d*=\'M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\']');
if (svg) {
let btn = svg.parentElement.parentElement;
btn.click();
let div = event.target?.parentElement?.parentElement?.parentElement?.nextSibling;

if (div) {
let btn = div.querySelector('button');
if (btn) {
btn.click();
setTimeout(() => {
let txt = div.querySelector('textarea')
if (txt) {
txt.selectionStart = txt.selectionEnd = txt.value.length;
txt.focus();
}
}, 0);
}
}
}
});
Expand Down

0 comments on commit 76efb88

Please sign in to comment.