__MSG_ask_chatgptweb_permission_2__ +
__MSG_ask_integration_permission_2__
__MSG_ask_integration_permission_2__ +
ThunderAI
diff --git a/pages/onboarding/onboarding.js b/pages/onboarding/onboarding.js index 5468c424..d9f8e6a7 100644 --- a/pages/onboarding/onboarding.js +++ b/pages/onboarding/onboarding.js @@ -32,13 +32,32 @@ document.addEventListener('DOMContentLoaded', async () => { let granted = await messenger.permissions.request({ origins: ["https://*.chatgpt.com/*"] }); if(granted){ document.getElementById("chatgpt_web_permission").style.display = "none"; - document.getElementById("chatgpt_web_permission_ok").style.display = "block"; - taLog.log("ChatGPT web permission granted"); + document.getElementById("integration_permission_ok").style.display = "block"; + taLog.log("ChatGPT Web permission granted"); }else{ - taLog.log("ChatGPT web permission denied"); + taLog.log("ChatGPT Web permission denied"); } }); - document.getElementById("chatgpt_web_permission_ok").addEventListener("click", async () => { + document.getElementById("integration_permission_ok").addEventListener("click", async () => { + await messenger.tabs.remove((await messenger.tabs.getCurrent()).id); + }); + } + } + if(prefs.connection_type === 'anthropic_api'){ + let permission_chatgpt = await messenger.permissions.contains({ origins: ["https://*.anthropic.com/*"] }); + if(permission_chatgpt === false){ + document.getElementById("anthropic_api_permission").style.display = "block"; + document.getElementById("anthropic_api_permission").addEventListener("click", async () => { + let granted = await messenger.permissions.request({ origins: ["https://*.anthropic.com/*"] }); + if(granted){ + document.getElementById("anthropic_api_permission").style.display = "none"; + document.getElementById("integration_permission_ok").style.display = "block"; + taLog.log("Anthropic API permission granted"); + }else{ + taLog.log("Anthropic API web permission denied"); + } + }); + document.getElementById("integration_permission_ok").addEventListener("click", async () => { await messenger.tabs.remove((await messenger.tabs.getCurrent()).id); }); } diff --git a/pages/spamfilter/mzta-spamfilter.html b/pages/spamfilter/mzta-spamfilter.html index 2496b976..cffc7831 100644 --- a/pages/spamfilter/mzta-spamfilter.html +++ b/pages/spamfilter/mzta-spamfilter.html @@ -33,7 +33,7 @@
diff --git a/popup/mzta-popup.css b/popup/mzta-popup.css index c547f20d..7aae2583 100644 --- a/popup/mzta-popup.css +++ b/popup/mzta-popup.css @@ -68,7 +68,7 @@ body { background-color: #cfe9ff; } - #ask_chatgpt_web_perm{ + #ask_chatgpt_web_perm, #ask_anthropic_api_perm{ display: none; max-width: 20em; background-color: red; diff --git a/popup/mzta-popup.html b/popup/mzta-popup.html index 67975cde..a6190e12 100644 --- a/popup/mzta-popup.html +++ b/popup/mzta-popup.html @@ -9,7 +9,10 @@
__MSG_ask_chatgptweb_permission_2_popup__ +
__MSG_ask_integration_permission_2_popup__ +
__MSG_ask_integration_permission_2_popup__
