using the api_active option

This commit is contained in:
mic 2024-07-20 23:27:27 +02:00
parent fe2ed3c00c
commit fda0378d08

View file

@ -146,6 +146,9 @@ async function openChatGPT(promptText, action, curr_tabId, prompt_name = '', do_
browser.tabs.sendMessage(curr_tabId, { command: "promptTooLong" }); browser.tabs.sendMessage(curr_tabId, { command: "promptTooLong" });
return; return;
} }
if(!prefs.api_active){
// We are using the ChatGPT web interface
let newWindow = await browser.windows.create({ let newWindow = await browser.windows.create({
url: "https://chatgpt.com", url: "https://chatgpt.com",
type: "popup", type: "popup",
@ -195,6 +198,10 @@ async function openChatGPT(promptText, action, curr_tabId, prompt_name = '', do_
.catch(err => { .catch(err => {
console.error("[ThunderAI] Error injecting the script: ", err); console.error("[ThunderAI] Error injecting the script: ", err);
}); });
}else{
// We are using the ChatGPT API
}
} }
function checkScreenDimensions(prefs){ function checkScreenDimensions(prefs){