log desc improved. fixes #63
This commit is contained in:
parent
f8602d4d4a
commit
83f570feaa
4 changed files with 14 additions and 14 deletions
|
|
@ -117,7 +117,7 @@ async function chatgpt_getFromDOM(pos) {
|
|||
|
||||
function chatpgt_scrollToBottom () {
|
||||
try { document.querySelector('button[class*="cursor"][class*="bottom"]').click(); }
|
||||
catch (err) { console.error('', err); }
|
||||
catch (err) { console.error('[ThunderAI] ', err); }
|
||||
}
|
||||
|
||||
function addCustomDiv(prompt_action,tabId) {
|
||||
|
|
@ -275,7 +275,7 @@ function checkGPT4Model() {
|
|||
for(element of elements){
|
||||
// Check if the element exists and its content is '4' or '4o'
|
||||
if ((element && element.textContent === '4')||(element && element.textContent === '4o')||(force_go)) {
|
||||
console.log("The GPT Model is now '4' or '4o'");
|
||||
console.log("[ThunderAI] The GPT Model is now '4' or '4o'");
|
||||
clearInterval(intervalId);
|
||||
clearTimeout(intervalId2);
|
||||
document.getElementById('mzta-model_warn').style.display = 'none';
|
||||
|
|
@ -283,7 +283,7 @@ function checkGPT4Model() {
|
|||
resolve("GPT4");
|
||||
break;
|
||||
} else if (!element) {
|
||||
console.log("Element not found!");
|
||||
console.log("[ThunderAI] Element not found!");
|
||||
clearInterval(intervalId);
|
||||
reject("Element not found.");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ export class mzta_Menus {
|
|||
|
||||
async reload(){
|
||||
await browser.menus.removeAll().catch(error => {
|
||||
console.error(">>>>>>>> ERROR removing the menus: ", error);
|
||||
console.error("[ThunderAI] ERROR removing the menus: ", error);
|
||||
});
|
||||
this.removeClickListener();
|
||||
this.loadMenus();
|
||||
|
|
|
|||
|
|
@ -55,10 +55,10 @@ messenger.runtime.onMessage.addListener(async (message, sender, sendResponse) =>
|
|||
return true;
|
||||
case 'chatgpt_close':
|
||||
browser.windows.remove(createdWindowID).then(() => {
|
||||
console.log("ChatGPT window closed successfully.");
|
||||
console.log("[ThunderAI] ChatGPT window closed successfully.");
|
||||
return true;
|
||||
}).catch((error) => {
|
||||
console.error("Error closing ChatGPT window:", error);
|
||||
console.error("[ThunderAI] Error closing ChatGPT window:", error);
|
||||
return false;
|
||||
});
|
||||
break;
|
||||
|
|
@ -115,7 +115,7 @@ messenger.runtime.onMessage.addListener(async (message, sender, sendResponse) =>
|
|||
break;
|
||||
case 'reload_menus':
|
||||
await menus.reload();
|
||||
console.log('>>>>>>>>>>>>>>>>> Reloaded menus');
|
||||
console.log('[ThunderAI] Reloaded menus');
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -129,7 +129,7 @@ messenger.runtime.onMessage.addListener(async (message, sender, sendResponse) =>
|
|||
async function openChatGPT(promptText, action, curr_tabId, do_custom_text = 0) {
|
||||
let prefs = await browser.storage.sync.get(prefs_default);
|
||||
prefs = checkScreenDimensions(prefs);
|
||||
console.log('Prompt length: ' + promptText.length);
|
||||
console.log('[ThunderAI] Prompt length: ' + promptText.length);
|
||||
if(promptText.length > 30000 ){
|
||||
// Prompt too long for ChatGPT
|
||||
browser.tabs.sendMessage(curr_tabId, { command: "promptTooLong" });
|
||||
|
|
@ -142,7 +142,7 @@ async function openChatGPT(promptText, action, curr_tabId, do_custom_text = 0) {
|
|||
height: prefs.chatgpt_win_height
|
||||
});
|
||||
|
||||
console.log("Script started...");
|
||||
console.log("[ThunderAI] Script started...");
|
||||
createdWindowID = newWindow.id;
|
||||
const createdTab = newWindow.tabs[0];
|
||||
|
||||
|
|
@ -173,11 +173,11 @@ async function openChatGPT(promptText, action, curr_tabId, do_custom_text = 0) {
|
|||
|
||||
browser.tabs.executeScript(createdTab.id, { code: pre_script + mzta_script, matchAboutBlank: false })
|
||||
.then(async () => {
|
||||
console.log("Script injected successfully");
|
||||
console.log("[ThunderAI] Script injected successfully");
|
||||
browser.tabs.sendMessage(createdTab.id, { command: "chatgpt_send", prompt: promptText, action: action, tabId: curr_tabId });
|
||||
})
|
||||
.catch(err => {
|
||||
console.error("Error injecting the script: ", err);
|
||||
console.error("[ThunderAI] Error injecting the script: ", err);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ function saveOptions(e) {
|
|||
if (element.tagName === 'SELECT') {
|
||||
options[element.id] = element.value;
|
||||
}else{
|
||||
console.log('Unhandled input type:', element.type);
|
||||
console.log('[ThunderAI] Unhandled input type:', element.type);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,14 +73,14 @@ function restoreOptions() {
|
|||
element.selectedIndex = -1;
|
||||
}
|
||||
}else{
|
||||
console.log('Unhandled input type:', element.type);
|
||||
console.log('[ThunderAI] Unhandled input type:', element.type);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function onError(error) {
|
||||
console.log(`Error: ${error}`);
|
||||
console.log(`[ThunderAI] Error: ${error}`);
|
||||
}
|
||||
|
||||
let getting = browser.storage.sync.get(null);
|
||||
|
|
|
|||
Loading…
Reference in a new issue