1)��Create a web page called ext.html that has a button on it. ��This web page can be located anywhere, but cannot be packaged with the extension.
2)��Create a Chrome extension that adds a div to the currently viewed page (can just be overlaid on top of the page), and adds an iframe in the div. ��Set the source of the iframe to the URL of ext.html
3)��Now, when you click the button in ext.html as seen in the iframe, it should tell the Chrome extension to toggle its icon. Do this any clean way you like, for example by using��postMessage() to have the iframe page send a message to its parent div, which in turn communicates to the extension via the Chrome��sendMessage().
4)��When the Chrome extension receives this message, it should toggle its icon to a different image. See��chrome.browseraction.setIcon.