ChatGPT Web Integration loading wait time option added. see #634

This commit is contained in:
mic 2026-02-15 10:30:22 +01:00
parent ae26e9288b
commit 5c310d1cb0
4 changed files with 22 additions and 2 deletions

View file

@ -699,6 +699,14 @@
"message": "If checked, the temporary chat will be used in the ChatGPT Web Interface.", "message": "If checked, the temporary chat will be used in the ChatGPT Web Interface.",
"description": "" "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": { "chatgpt_btn_model": {
"message": "Use the current model", "message": "Use the current model",
"description": "" "description": ""

View file

@ -429,7 +429,7 @@ async function openChatGPT(promptText, action, curr_tabId, prompt_name = '', do_
let rand_call_id = '_chatgptweb_' + generateCallID(); let rand_call_id = '_chatgptweb_' + generateCallID();
let call_opt = ''; let call_opt = '';
let _wait_time = 1000; let _wait_time = prefs.chatgpt_web_load_wait_time;
let _base_url = "https://chatgpt.com"; let _base_url = "https://chatgpt.com";
let _webproject_set = false; let _webproject_set = false;
let _custom_gpt_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 != ''))){ if(!_use_prompt_info_custom_gpt && ((prompt_info.chatgpt_web_project != '') || (prefs.chatgpt_web_project != ''))){
_base_url += _web_project; _base_url += _web_project;
_webproject_set = true; _webproject_set = true;
_wait_time = 2000; _wait_time += 1000;
} }
if(!_webproject_set && ((prompt_info.chatgpt_web_custom_gpt != '') || (prefs.chatgpt_web_custom_gpt != ''))){ if(!_webproject_set && ((prompt_info.chatgpt_web_custom_gpt != '') || (prefs.chatgpt_web_custom_gpt != ''))){
_base_url += _custom_gpt; _base_url += _custom_gpt;

View file

@ -108,6 +108,7 @@ export const prefs_default = {
chatgpt_web_tempchat: false, chatgpt_web_tempchat: false,
chatgpt_web_project: '', chatgpt_web_project: '',
chatgpt_web_custom_gpt: '', chatgpt_web_custom_gpt: '',
chatgpt_web_load_wait_time: 1000,
dynamic_menu_force_enter: false, dynamic_menu_force_enter: false,
dynamic_menu_order_alphabet: true, dynamic_menu_order_alphabet: true,
placeholders_use_default_value: false, placeholders_use_default_value: false,

View file

@ -153,6 +153,17 @@ export async function injectConnectionUI({
</label> </label>
</td> </td>
</tr> </tr>
<tr class="conntype_chatgpt_web${tr_class ? ` ${tr_class}` : ''}">
<td><label>
<span class="opt_title">__MSG_prefs_OptionText_chatgpt_web_load_wait_time__</span>
</label></td>
<td>
<label>
<input type="number" id="chatgpt_web_load_wait_time" name="chatgpt_web_load_wait_time" class="option-input" />
<br>__MSG_prefs_OptionText_chatgpt_web_load_wait_time_info__
</label>
</td>
</tr>
<tr class="conntype_chatgpt_web${tr_class ? ` ${tr_class}` : ''}"> <tr class="conntype_chatgpt_web${tr_class ? ` ${tr_class}` : ''}">
<td colspan="2" style="padding:0px 2em;text-align:center;"><span>__MSG_OpenChatGPTTab_Info__</span> <td colspan="2" style="padding:0px 2em;text-align:center;"><span>__MSG_OpenChatGPTTab_Info__</span>
<br><br><button id="btnChatGPTWeb_Tab">__MSG_OpenChatGPTTab__</button> <br><br><button id="btnChatGPTWeb_Tab">__MSG_OpenChatGPTTab__</button>