Skip to content

Commit 384ec24

Browse files
author
Maxim Fomin
committed
grok fixed
1 parent 20a99b6 commit 384ec24

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

utils.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -259,19 +259,25 @@ class InjectionTargetsOnWebsite {
259259
buttonsContainerId: 'aistudio-custom-buttons-container'
260260
},
261261
Grok: {
262-
// Updated Grok selectors: injecting custom buttons into the chat form to avoid conflicts.
263-
// Use the form element as container.
262+
// Updated selectors for new Grok UI (April 2025)
263+
// Container: the chat form (unique structure)
264264
containers: [
265-
'form.bottom-0.w-full.text-base.flex.flex-col.gap-2.items-center.justify-center.relative.z-10'
265+
'form.bottom-0.w-full.text-base.flex.flex-col.gap-2.items-center.justify-center.relative.z-10',
266+
'form.w-full.flex-col.items-center.justify-center', // fallback if classes change
267+
'form[method][class*="gap-2"][class*="flex-col"]' // fallback for structure
266268
],
267-
// Use a more specific selector for the send button (submit button within that form).
269+
// Send button: submit button at the bottom of the chat form
268270
sendButtons: [
269-
'form.bottom-0.w-full.text-base.flex.flex-col.gap-2.items-center.justify-center.relative.z-10 button[type="submit"].group'
271+
'form.bottom-0.w-full.text-base.flex.flex-col.gap-2.items-center.justify-center.relative.z-10 button[type="submit"]',
272+
'form button[type="submit"].group', // fallback if .group class remains
273+
'form button[type="submit"]' // fallback: any submit button in form
270274
],
271-
// Editors remain as before.
275+
// Editor: textarea inside the chat form, with new class structure
272276
editors: [
273-
'textarea.w-full.bg-transparent.focus\\:outline-none.text-primary',
274-
'textarea.w-full.px-2.\\@\\[480px\\]\\/input\\:px-3.pt-5.mb-5.bg-transparent.focus\\:outline-none.text-primary.align-bottom'
277+
'form.bottom-0.w-full.text-base.flex.flex-col.gap-2.items-center.justify-center.relative.z-10 textarea[aria-label="Ask Grok anything"]',
278+
'textarea[aria-label="Ask Grok anything"]',
279+
'textarea.w-full.px-2', // fallback for px-2 class
280+
'textarea' // fallback: any textarea
275281
],
276282
buttonsContainerId: 'grok-custom-buttons-container'
277283
},

0 commit comments

Comments
 (0)