I am sure this is answered somewhere, but I’m having trouble coming up with the right way to search for it. Also writing out this question has helped me think it through a bit so if this kind of question a bit too low effort I’ll remove it.
I want to develop an extension where users can select an element with the mouse much like with the inspector tool. Like with colorzilla if anyone has used that. I want to have access to the Element after a user clicks it.
From the popup, once a user clicks a button like ‘select element’, I’d like to register a mouse click event listener. So that when the user clicks on something in the page they are on I get access to this element.
Is this the right track? Or does anyone have better ideas or something I may be missing? And if anyone knows where in the docs I should poke around? Thanks.