CSUI Best practices question
Can I get some advice on what is the best way for me to append a new button shown in the screenshots?
The inspected the element and it doesn't seem to have a unique
id
i can target in the content script.
My first hunch is to use querySelector
but I think this is a very brittle method.
So what is the best way to do this? And how would that method stand against layout changes deployed by OpenAI ?

11 Replies
update
this is what i have so far:
not seeing the
Test
button render even though it is found from document.querySelector
, am i doing something wrong ?
update #2
i think i'm getting close... the button appears for a split second and disappears ? again, not sure what could be causing this
this is what i have so far :
@louis 🙏🏻🙏🏻🙏🏻
is this something to do with the mutation observer of the web page? it's weird how it's there and then disappears
I would think that it should be working. Maybe try setting min height/width on the button you're injecting?
I think you need to export default TestButton
no luck 😦
no luck 😦
hey @louis could i get some assistance please? 🙏
You're pretty much on your own with the render API - I just expose it for advanced escape hatch but otherwise it's wild west. Note that when using the render API, the anchor might not be hooked inside, so I would debug the container and see what's going on. Just log it out and see what you find.
it looks like i don't need to use the render API :
but this still only displays the button for a split second before disappearing (attached video) - this is what i am mainly confused about, idk what could be causing this behaviour
and how would i debug the container? do you mean just inspect element?
it looks like that element is being rerendered or something so I would think you'd need to remount the button not 100% sure thats just a guess
dumb question, but how would i remount as you suggested?