diff --git a/src/config/index.mjs b/src/config/index.mjs index 0206ca29..e4458c88 100644 --- a/src/config/index.mjs +++ b/src/config/index.mjs @@ -45,7 +45,7 @@ export const poeWebModelKeys = [ 'poeAiWebSage', 'poeAiWebGPT4', 'poeAiWebGPT4_32k', - 'poeAiWebClaude_2_100k', + 'poeAiWebClaudePlus', 'poeAiWebClaude', 'poeAiWebClaude100k', 'poeAiWebCustom', @@ -77,7 +77,7 @@ export const Models = { poeAiWebSage: { value: 'sage', desc: 'Poe AI (Web, Sage)' }, poeAiWebGPT4: { value: 'gpt-4', desc: 'Poe AI (Web, GPT-4)' }, poeAiWebGPT4_32k: { value: 'gpt-4-32k', desc: 'Poe AI (Web, GPT-4-32k)' }, - poeAiWebClaude_2_100k: { value: 'claude-2-100k', desc: 'Poe AI (Web, Claude 2 100k)' }, + poeAiWebClaudePlus: { value: 'claude-2-100k', desc: 'Poe AI (Web, Claude 2 100k)' }, poeAiWebClaude: { value: 'claude-instant', desc: 'Poe AI (Web, Claude instant)' }, poeAiWebClaude100k: { value: 'claude-instant-100k', desc: 'Poe AI (Web, Claude instant 100k)' }, poeAiWebGooglePaLM: { value: 'Google-PaLM', desc: 'Poe AI (Web, Google-PaLM)' }, @@ -169,7 +169,7 @@ export const defaultConfig = { 'poeAiWebSage', 'poeAiWebGPT4', 'poeAiWebGPT4_32k', - 'poeAiWebClaude_2_100k', + 'poeAiWebClaudePlus', 'poeAiWebClaude100k', 'chatgptApi4_8k', 'customModel', diff --git a/src/content-script/index.jsx b/src/content-script/index.jsx index 23915a3e..a08e6843 100644 --- a/src/content-script/index.jsx +++ b/src/content-script/index.jsx @@ -313,9 +313,11 @@ async function prepareForForegroundRequests() { if (!chatgptWebModelKeys.some((model) => userConfig.activeApiModes.includes(model))) return - const div = document.createElement('div') - document.body.append(div) - render(, div) + if (chatgptWebModelKeys.includes(userConfig.modelName)) { + const div = document.createElement('div') + document.body.append(div) + render(, div) + } await Browser.runtime.sendMessage({ type: 'SET_CHATGPT_TAB', diff --git a/src/manifest.json b/src/manifest.json index 798855f2..bad43fd4 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,7 +1,7 @@ { "name": "ChatGPTBox", "description": "Integrating ChatGPT into your browser deeply, everything you need is here", - "version": "2.3.9", + "version": "2.4.0", "manifest_version": 3, "icons": { "16": "logo.png", diff --git a/src/manifest.v2.json b/src/manifest.v2.json index cad4e418..11f49d4e 100644 --- a/src/manifest.v2.json +++ b/src/manifest.v2.json @@ -1,7 +1,7 @@ { "name": "ChatGPTBox", "description": "Integrating ChatGPT into your browser deeply, everything you need is here", - "version": "2.3.9", + "version": "2.4.0", "manifest_version": 2, "icons": { "16": "logo.png", @@ -57,7 +57,7 @@ "newChat": { "suggested_key": { "default": "Ctrl+B", - "mac": "MacCtrl+B" + "mac": "MacCtrl+X" }, "description": "Create a new chat" }, diff --git a/src/services/apis/chatgpt-web.mjs b/src/services/apis/chatgpt-web.mjs index 67ee05ef..89f11c0b 100644 --- a/src/services/apis/chatgpt-web.mjs +++ b/src/services/apis/chatgpt-web.mjs @@ -113,6 +113,13 @@ export async function generateAnswersWithChatgptWebApi(port, question, session, timezone_offset_min: new Date().getTimezoneOffset(), variant_purpose: 'none', history_and_training_disabled: config.disableWebModeHistory, + arkose_token: usedModel.startsWith('gpt-4') + ? `${Array.from({ length: 17 }, () => Math.floor(Math.random() * 16).toString(16)).join( + '', + )}|r=ap-southeast-1|meta=3|meta_width=300|metabgclr=transparent|metaiconclr=%23555555|guitextcolor=%23000000|pk=35536E1E-65B4-4D96-9D97-6ADB7EFF8147|at=40|sup=1|rid=${ + Math.floor(Math.random() * 99) + 1 + }|ag=101|cdn_url=https%3A%2F%2Ftcr9i.chat.openai.com%2Fcdn%2Ffc|lurl=https%3A%2F%2Faudio-ap-southeast-1.arkoselabs.com|surl=https%3A%2F%2Ftcr9i.chat.openai.com|smurl=https%3A%2F%2Ftcr9i.chat.openai.com%2Fcdn%2Ffc%2Fassets%2Fstyle-manager` + : undefined, }), onMessage(message) { console.debug('sse message', message)