I am looking for a way to remove iframe that I injected through my content_script. I want the frame to be removed when url of the webpage changes. There is no way to add listener to current page url changes or to use chrome.tabs.onUpdated.addListener in the content script. I can resort to other methods like setting timer that checks url every second or so but I want to know if there is a better way to do this.
This is my first chrome extension. Any help would be appreciated!