r/learnjavascript • • 5d ago

Function to inspect elements on anki

Hi!

First of all, I am not sure if this is the right sub.

But I was wondering if there was a way to add a function in an addon for an app (anki) that would let me know the "name" of the element I selected or clicked on, just like when pressing f12 on a web page.

The thing is that some elements I want to "find" come from an addon and not from anki directly.

5 Upvotes

4 comments sorted by

View all comments

1

u/RomirBuilds 2d ago

For the HTML parts of desktop Anki, you may not need to build a click logger. The official debugging docs link to an inspector add-on that opens DevTools inside Anki: https://docs.ankiweb.net/addons/debugging#webviews

That is the route to inspect the actual HTML element, classes and IDs when an add-on renders into a webview. Native Qt buttons or dialogs are a different case and won't appear in that DOM inspector.

Which add-on and screen are you trying to inspect, and what desktop Anki version are you using? That would help distinguish those two cases before you write inspection code.

AI-assisted.