Skip to content

Commit ab27e56

Browse files
committed
Update Mistral chatbot URL and selectors
- in case of `apps/browser/src/content-scripts/send-prompt-content-script/chatbots/mistral.ts`, in wait until ready: wait when a button with the concrete svg appears in div[data-chat-input-bar="true"] [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
1 parent b86861a commit ab27e56

4 files changed

Lines changed: 14 additions & 17 deletions

File tree

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

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ export const mistral: Chatbot = {
99
wait_until_ready: async () => {
1010
await new Promise((resolve) => {
1111
const check_for_element = () => {
12-
if (document.querySelector('div[contenteditable="true"]')) {
12+
if (
13+
document.querySelector(
14+
'div[data-chat-input-bar="true"] > div >div > div > div > div:last-child button'
15+
)
16+
) {
1317
resolve(null)
1418
} else {
1519
setTimeout(check_for_element, 100)
@@ -22,12 +26,9 @@ export const mistral: Chatbot = {
2226
set_options: async (chat) => {
2327
const options = chat.options
2428

25-
if (
26-
options?.includes('incognito') &&
27-
!window.location.pathname.includes('/incognito')
28-
) {
29+
if (options?.includes('incognito')) {
2930
const incognito_button = document.querySelector(
30-
'a[href="/incognito"]'
31+
'a[href="/work/temporary-chat"]'
3132
) as HTMLAnchorElement
3233
if (incognito_button) {
3334
incognito_button.click()
@@ -117,7 +118,7 @@ export const mistral: Chatbot = {
117118
footer,
118119
perform_copy: (f) => {
119120
const copy_button = f.querySelector(
120-
'button:nth-child(6)'
121+
'button:nth-child(5)'
121122
) as HTMLElement
122123
if (!copy_button) {
123124
report_initialization_error({
@@ -139,16 +140,12 @@ export const mistral: Chatbot = {
139140
})
140141
}
141142

142-
const footer_selector =
143-
'div[data-message-author-role="assistant"] > div + div > div:last-child > div:first-child'
144-
145143
requestAnimationFrame(() => {
146144
observe_for_responses({
147145
chatbot_name: 'Mistral',
148-
is_generating: () =>
149-
!document.querySelector(footer_selector) ||
150-
!!document.querySelector('form rect[rx="2"]'),
151-
footer_selector,
146+
is_generating: () => !!document.querySelector('form rect[rx="2"]'),
147+
footer_selector:
148+
'div[data-message-author-role="assistant"] > div > div:last-child > div:first-child',
152149
add_buttons: params.inject_button ? add_buttons : undefined
153150
})
154151
})

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const is_claude = current_url.startsWith(claude_url)
5454
const deepseek_url = 'https://chat.deepseek.com/'
5555
const is_deepseek = current_url.startsWith(deepseek_url)
5656

57-
const mistral_url = 'https://chat.mistral.ai/'
57+
const mistral_url = 'https://chat.mistral.ai/work'
5858
const is_mistral = current_url.startsWith(mistral_url)
5959

6060
const qwen_url = 'https://chat.qwen.ai/'

‎apps/browser/src/manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"https://www.kimi.ai/",
3939
"https://www.kimi.com/",
4040
"https://www.meta.ai/",
41-
"https://chat.mistral.ai/*",
41+
"https://chat.mistral.ai/work*",
4242
"http://openwebui/",
4343
"https://openrouter.ai/chat*",
4444
"https://chat.qwen.ai/*",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export const CHATBOTS = {
130130
url: 'https://www.meta.ai/'
131131
} as Chatbot,
132132
Mistral: {
133-
url: 'https://chat.mistral.ai/chat',
133+
url: 'https://chat.mistral.ai/work',
134134
supports_url_override: true,
135135
url_override_label: 'Project URL',
136136
url_override_disabled_options: ['incognito'],

0 commit comments

Comments
 (0)