Skip to content

Commit dd3d58f

Browse files
committed
Add support for the think free option in ChatGPT
- in chatgpt, add 'think (free)' option. Should not target 'Think' button by label so that it continues to work in other languages. [Pasted text] ├── apps │ └── browser │ └── src │ └── content-scripts │ └── send-prompt-content-script │ ├── chatbots │ │ ├── ai-studio.ts │ │ ├── arena.ts │ │ ├── chatgpt.ts │ │ ├── claude.ts │ │ ├── copilot.ts │ │ ├── deepseek.ts │ │ ├── doubao.ts │ │ ├── gemini.ts │ │ ├── github-copilot.ts │ │ ├── grok.ts │ │ ├── hugging-chat.ts │ │ ├── index.ts │ │ ├── kimi.ts │ │ ├── meta.ts │ │ ├── mistral.ts │ │ ├── open-webui.ts │ │ ├── openrouter.ts │ │ ├── qwen.ts │ │ ├── together.ts │ │ ├── yuanbao.ts │ │ └── z-ai.ts │ ├── constants │ │ ├── apply-response-icon.ts │ │ └── dictionary.ts │ ├── send-prompt-content-script.ts │ ├── types │ │ └── chatbot.ts │ └── utils │ ├── add-apply-response-button.ts │ ├── apply-response-styles.ts │ ├── logger.ts │ ├── report-initialization-error.ts │ └── show-response-ready-notification.ts └── packages └── shared └── src └── constants └── chatbots.ts
1 parent 7a3f4dd commit dd3d58f

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

  • apps/browser/src/content-scripts/send-prompt-content-script/chatbots
  • packages/shared/src/constants

‎apps/browser/src/content-scripts/send-prompt-content-script/chatbots/chatgpt.ts‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,26 @@ export const chatgpt: Chatbot = {
6161
// Don't show alert because temporary mode doesn't work in projects (url override)
6262
})
6363
}
64+
} else if (
65+
option == 'think (free)' &&
66+
supported_options?.['think (free)']
67+
) {
68+
const think_icon_path = document.querySelector(
69+
'path[d^="M14.8974 2.29998"]'
70+
)
71+
if (think_icon_path) {
72+
const think_button = think_icon_path.closest(
73+
'button'
74+
) as HTMLButtonElement
75+
if (think_button) {
76+
think_button.click()
77+
}
78+
} else {
79+
report_initialization_error({
80+
function_name: 'set_options',
81+
log_message: 'Think button icon not found'
82+
})
83+
}
6484
}
6585
}
6686
},

‎packages/shared/src/constants/chatbots.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ export const CHATBOTS = {
5656
url_override_label: 'Project URL',
5757
url_override_disabled_options: ['temporary'],
5858
supported_options: {
59-
temporary: 'Temporary'
59+
temporary: 'Temporary',
60+
'think (free)': 'Think (free)'
6061
}
6162
} as Chatbot,
6263
Claude: {

0 commit comments

Comments
 (0)