I'm writing an extension that reacts to right-clicks on images on the page. I'd like to know the image's dimensions to do further processing.
Out of the box, my callback gets a reference to the tab and an "info" object (OnClickData), which only exposes minimal information.
Has anyone hit this scenario before? I'm thinking of either
- loading the image again based on the srcUrl (may not be reproducible if the URL is dynamic) and interrogating it
- trying to walk the DOM of the tab to find the image and interrogate it (not sure if this would require a content script to cross the boundary from extension to webpage)