Skip to content

Commit

Permalink
Merge branch 'josStorer:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
okkidwi committed Jul 17, 2023
2 parents 80adc22 + 5963049 commit 627bd63
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/config/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const poeWebModelKeys = [
'poeAiWebSage',
'poeAiWebGPT4',
'poeAiWebGPT4_32k',
'poeAiWebClaude_2_100k',
'poeAiWebClaudePlus',
'poeAiWebClaude',
'poeAiWebClaude100k',
'poeAiWebCustom',
Expand Down Expand Up @@ -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)' },
Expand Down Expand Up @@ -169,7 +169,7 @@ export const defaultConfig = {
'poeAiWebSage',
'poeAiWebGPT4',
'poeAiWebGPT4_32k',
'poeAiWebClaude_2_100k',
'poeAiWebClaudePlus',
'poeAiWebClaude100k',
'chatgptApi4_8k',
'customModel',
Expand Down
8 changes: 5 additions & 3 deletions src/content-script/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(<NotificationForChatGPTWeb container={div} />, div)
if (chatgptWebModelKeys.includes(userConfig.modelName)) {
const div = document.createElement('div')
document.body.append(div)
render(<NotificationForChatGPTWeb container={div} />, div)
}

await Browser.runtime.sendMessage({
type: 'SET_CHATGPT_TAB',
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/manifest.v2.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -57,7 +57,7 @@
"newChat": {
"suggested_key": {
"default": "Ctrl+B",
"mac": "MacCtrl+B"
"mac": "MacCtrl+X"
},
"description": "Create a new chat"
},
Expand Down
7 changes: 7 additions & 0 deletions src/services/apis/chatgpt-web.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 627bd63

Please sign in to comment.