diff --git a/CHANGELOG.md b/CHANGELOG.md
index 21430e97..9549b0b5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,11 @@
#  ThunderAI Release Notes
+
Version 1.0.6 - 08/05/2024
+
+- Correctly handling a change in the ChatGPT web interface. See issue #43
+- Added a button to force the completion to display the 'Use last answer' button if ChatGPT has finished its work but the button has not appeared.
+
Version 1.0.5 - 03/05/2024
- Fixed the handling of ChatGPT-4 in a large window. See issue #38
diff --git a/_locales/en/messages.json b/_locales/en/messages.json
index 4d6b255a..b38ccee4 100644
--- a/_locales/en/messages.json
+++ b/_locales/en/messages.json
@@ -279,6 +279,16 @@
"description": ""
},
+ "chatgpt_force_completion": {
+ "message": "force completion",
+ "description": ""
+ },
+
+ "chatgpt_force_completion_title": {
+ "message": "Click here to display the 'Use last answer' button if ChatGPT has finished its work but the button has not appeared.",
+ "description": ""
+ },
+
"msg_prompt_too_long": {
"message": "The text you provided is too long. You need to reduce it to use ChatGPT.",
"description": ""
diff --git a/_locales/it/messages.json b/_locales/it/messages.json
index 8f4dd146..2a3d6920 100644
--- a/_locales/it/messages.json
+++ b/_locales/it/messages.json
@@ -99,6 +99,16 @@
"description": ""
},
+ "chatgpt_force_completion": {
+ "message": "forza il completamento",
+ "description": ""
+ },
+
+ "chatgpt_force_completion_title": {
+ "message": "Fai clic qui per visualizzare il pulsante 'Usa l'ultima risposta' se ChatGPT ha terminato il suo lavoro ma il pulsante non è apparso.",
+ "description": ""
+ },
+
"msg_prompt_too_long": {
"message": "Il testo che vuoi inviare a ChatGPT è troppo lungo. Devi ridurlo per poter procedere.",
"description": ""
diff --git a/js/mzta-chatgpt.js b/js/mzta-chatgpt.js
index 0dc0f114..4e6c8ac7 100644
--- a/js/mzta-chatgpt.js
+++ b/js/mzta-chatgpt.js
@@ -47,7 +47,7 @@ async function chatgpt_isIdle() {
function chatgpt_getRegenerateButton() {
for (const mainSVG of document.querySelectorAll('main svg')) {
- if (mainSVG.querySelector('path[d*="M4.5 2.5C5.05228"]')) // regen icon found
+ if (mainSVG.querySelector('path[d*="M3.07 10.876C3.623"]')) // regen icon found
return mainSVG.parentNode.parentNode;
}
}
@@ -120,7 +120,8 @@ function addCustomDiv(prompt_action,tabId) {
style.innerHTML += "#mzta-model_warn{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);max-height:100%px;min-width:30%;max-width:50%;padding:3px;border-radius:5px;text-align:center;background-color:#FFBABA;border:1px solid;font-size:13px;color:#D8000C;display:none;}";
style.innerHTML += "#mzta-btn_gpt35 {background-color: #007bff;border: none;color: white;padding: 2px 4px;text-align: center;text-decoration: none;display: none;font-size: 13px;margin-left: 4px;transition-duration: 0.4s;cursor: pointer;border-radius: 2px;}";
style.innerHTML += "#mzta-status-page{position:fixed;bottom:0;left:0;padding-left:5px;font-size:13px;font-style:italic;text-decoration:underline;color:#919191;}";
- style.innerHTML += "#mzta-status-page:hover{color:#007bff;}";
+ style.innerHTML += "#mzta-force-completion{cursor:pointer;position:fixed;bottom:0;right:0;padding-right:5px;font-size:13px;font-style:italic;text-decoration:underline;color:#919191;}";
+ style.innerHTML += "#mzta-status-page:hover, #mzta-force-completion:hover{color:#007bff;}";
style.innerHTML += "#mzta-custom_text{padding:10px;width:auto;max-width:80%;height:auto;max-height:80%;border-radius:5px;overflow:auto;position:fixed;top:50%;left:50%;display:none;transform:translate(-50%,-50%);text-align:center;background:#333;color:white;border:3px solid white;}";
style.innerHTML += "#mzta-custom_loading{height:50px;display:none;}";
style.innerHTML += "#mzta-custom_textarea{color:black;padding:1px;font-size:15px;width:100%;}";
@@ -155,6 +156,16 @@ function addCustomDiv(prompt_action,tabId) {
status_page_div.innerHTML = ''+ mztaStatusPageDesc +'';
fixedDiv.appendChild(status_page_div);
+ //force completion
+ var force_completion_div = document.createElement('div');
+ force_completion_div.id = 'mzta-force-completion';
+ force_completion_div.innerHTML = mztaForceCompletionDesc;
+ force_completion_div.title = mztaForceCompletionTitle;
+ force_completion_div.addEventListener('click', function() {
+ operation_done();
+ });
+ fixedDiv.appendChild(force_completion_div);
+
// span for the text
var curr_msg = document.createElement('span');
curr_msg.id='mzta-curr_msg';
@@ -275,6 +286,7 @@ function operation_done(){
document.getElementById('mzta-curr_msg').innerHTML = browser.i18n.getMessage("chatgpt_win_job_completed")+"
";
document.getElementById('mzta-btn_ok').style.display = 'inline';
document.getElementById('mzta-loading').style.display = 'none';
+ document.getElementById('mzta-force-completion').style.display = 'none';
chatpgt_scrollToBottom();
}
diff --git a/mzta-background.js b/mzta-background.js
index cad1e6f3..ca23d104 100644
--- a/mzta-background.js
+++ b/mzta-background.js
@@ -166,6 +166,8 @@ async function openChatGPT(promptText, action, curr_tabId, do_custom_text = 0) {
});
let pre_script = `let mztaStatusPageDesc="`+ browser.i18n.getMessage("prefs_status_page") +`";
+ let mztaForceCompletionDesc="`+ browser.i18n.getMessage("chatgpt_force_completion") +`";
+ let mztaForceCompletionTitle="`+ browser.i18n.getMessage("chatgpt_force_completion_title") +`";
let mztaDoCustomText=`+ do_custom_text +`;
`;
diff --git a/options/mzta-release-notes.html b/options/mzta-release-notes.html
index e17bd08a..f3094551 100644
--- a/options/mzta-release-notes.html
+++ b/options/mzta-release-notes.html
@@ -12,6 +12,11 @@
- A prompt can be configured to request additional text from the user.
- ...
+ Version 1.0.6 - 08/05/2024
+
+ - Correctly handling a change in the ChatGPT web interface. See issue #43
+ - Added a button to force the completion to display the 'Use last answer' button if ChatGPT has finished its work but the button has not appeared.
+
Version 1.0.5 - 03/05/2024
- Fixed the handling of ChatGPT-4 in a large window. See issue #38