From 5c310d1cb019dfb41eacb581adf12e61cf11d9cf Mon Sep 17 00:00:00 2001 From: mic Date: Sun, 15 Feb 2026 10:30:22 +0100 Subject: [PATCH] ChatGPT Web Integration loading wait time option added. see #634 --- _locales/en/messages.json | 8 ++++++++ mzta-background.js | 4 ++-- options/mzta-options-default.js | 1 + pages/_lib/connection-ui.js | 11 +++++++++++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 60a2e279..97410de8 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -699,6 +699,14 @@ "message": "If checked, the temporary chat will be used in the ChatGPT Web Interface.", "description": "" }, + "prefs_OptionText_chatgpt_web_load_wait_time": { + "message": "Wait time for page load", + "description": "" + }, + "prefs_OptionText_chatgpt_web_load_wait_time_info": { + "message": "Time in milliseconds to wait for the ChatGPT page to load before loading the additional content. Default is 1000ms. If a Custom GPT or Project is defined, additional 1000ms will be added to this value.", + "description": "" + }, "chatgpt_btn_model": { "message": "Use the current model", "description": "" diff --git a/mzta-background.js b/mzta-background.js index ea2473fd..7be949a3 100644 --- a/mzta-background.js +++ b/mzta-background.js @@ -429,7 +429,7 @@ async function openChatGPT(promptText, action, curr_tabId, prompt_name = '', do_ let rand_call_id = '_chatgptweb_' + generateCallID(); let call_opt = ''; - let _wait_time = 1000; + let _wait_time = prefs.chatgpt_web_load_wait_time; let _base_url = "https://chatgpt.com"; let _webproject_set = false; let _custom_gpt_set = false; @@ -457,7 +457,7 @@ async function openChatGPT(promptText, action, curr_tabId, prompt_name = '', do_ if(!_use_prompt_info_custom_gpt && ((prompt_info.chatgpt_web_project != '') || (prefs.chatgpt_web_project != ''))){ _base_url += _web_project; _webproject_set = true; - _wait_time = 2000; + _wait_time += 1000; } if(!_webproject_set && ((prompt_info.chatgpt_web_custom_gpt != '') || (prefs.chatgpt_web_custom_gpt != ''))){ _base_url += _custom_gpt; diff --git a/options/mzta-options-default.js b/options/mzta-options-default.js index ddeae06f..f2b5eb83 100644 --- a/options/mzta-options-default.js +++ b/options/mzta-options-default.js @@ -108,6 +108,7 @@ export const prefs_default = { chatgpt_web_tempchat: false, chatgpt_web_project: '', chatgpt_web_custom_gpt: '', + chatgpt_web_load_wait_time: 1000, dynamic_menu_force_enter: false, dynamic_menu_order_alphabet: true, placeholders_use_default_value: false, diff --git a/pages/_lib/connection-ui.js b/pages/_lib/connection-ui.js index 8683f077..64a0d0eb 100644 --- a/pages/_lib/connection-ui.js +++ b/pages/_lib/connection-ui.js @@ -153,6 +153,17 @@ export async function injectConnectionUI({ + + + + + + __MSG_OpenChatGPTTab_Info__