var name fixed

This commit is contained in:
mic 2026-03-04 21:38:38 +01:00
parent a401626805
commit 83a147fdea

View file

@ -732,13 +732,13 @@ async function openChatGPT(promptText, action, curr_tabId, prompt_name = '', do_
{ {
// We are using the Anthropic API // We are using the Anthropic API
let rand_call_id5 = '_anthropic_' + generateCallID(); let rand_call_id6 = '_anthropic_' + generateCallID();
const listener5 = (message, sender, sendResponse) => { const listener6 = (message, sender, sendResponse) => {
function handleAnthropicApi(createdTab) { function handleAnthropicApi(createdTab) {
let mailMessageId5 = -1; let mailMessageId6 = -1;
if(mailMessage) mailMessageId5 = mailMessage.id; if(mailMessage) mailMessageId6 = mailMessage.id;
// check if the config is present, or give a message error // check if the config is present, or give a message error
if (prefs.anthropic_api_key == '') { if (prefs.anthropic_api_key == '') {
@ -754,32 +754,32 @@ async function openChatGPT(promptText, action, curr_tabId, prompt_name = '', do_
return; return;
} }
//console.log(">>>>>>>>>> sender: " + JSON.stringify(sender)); //console.log(">>>>>>>>>> sender: " + JSON.stringify(sender));
browser.tabs.sendMessage(createdTab.id, { command: "api_send", prompt: promptText, action: action, tabId: curr_tabId, mailMessageId: mailMessageId5, do_custom_text: do_custom_text, prompt_info: prompt_info}); browser.tabs.sendMessage(createdTab.id, { command: "api_send", prompt: promptText, action: action, tabId: curr_tabId, mailMessageId: mailMessageId6, do_custom_text: do_custom_text, prompt_info: prompt_info});
taLog.log('[OpenAI ChatGPT] Connection succeded!'); taLog.log('[OpenAI ChatGPT] Connection succeded!');
browser.runtime.onMessage.removeListener(listener5); browser.runtime.onMessage.removeListener(listener6);
} }
if (message.command === "anthropic_api_ready_"+rand_call_id5) { if (message.command === "anthropic_api_ready_"+rand_call_id6) {
return handleAnthropicApi(sender.tab); return handleAnthropicApi(sender.tab);
} }
return false; return false;
} }
browser.runtime.onMessage.addListener(listener5); browser.runtime.onMessage.addListener(listener6);
let win_options5 = { let win_options6 = {
url: browser.runtime.getURL('api_webchat/index.html?llm='+prefs.connection_type+'&call_id='+rand_call_id5+'&ph_def_val='+(prefs.placeholders_use_default_value?'1':'0')+'&prompt_id='+encodeURIComponent(prompt_info.id) + '&prompt_name=' + encodeURIComponent(i18nConditionalGet(prompt_info.name))), url: browser.runtime.getURL('api_webchat/index.html?llm='+prefs.connection_type+'&call_id='+rand_call_id6+'&ph_def_val='+(prefs.placeholders_use_default_value?'1':'0')+'&prompt_id='+encodeURIComponent(prompt_info.id) + '&prompt_name=' + encodeURIComponent(i18nConditionalGet(prompt_info.name))),
type: "popup", type: "popup",
} }
taLog.log("[chatgpt_api] prefs.chatgpt_win_width: " + prefs.chatgpt_win_width + ", prefs.chatgpt_win_height: " + prefs.chatgpt_win_height); taLog.log("[chatgpt_api] prefs.chatgpt_win_width: " + prefs.chatgpt_win_width + ", prefs.chatgpt_win_height: " + prefs.chatgpt_win_height);
if((prefs.chatgpt_win_width != '') && (prefs.chatgpt_win_height != '') && (prefs.chatgpt_win_width != 0) && (prefs.chatgpt_win_height != 0)){ if((prefs.chatgpt_win_width != '') && (prefs.chatgpt_win_height != '') && (prefs.chatgpt_win_width != 0) && (prefs.chatgpt_win_height != 0)){
win_options5.width = prefs.chatgpt_win_width, win_options6.width = prefs.chatgpt_win_width,
win_options5.height = prefs.chatgpt_win_height win_options6.height = prefs.chatgpt_win_height
} }
await browser.windows.create(win_options5); await browser.windows.create(win_options6);
} }
break; // anthropic_api - END break; // anthropic_api - END