I am building a chrome extension that should get notified every time a new tab has opened and load page, and for that purpose I'am using chrome.tabs.onUpdated event.
The problem is that in case an iframe is inserted on that page/tab that is hosted on some domain(has src), onUpdated event is trigered. Is there a way to differentiate these events for "real" tab load from those triggered for iframe load?
tabs.onUpdated triggers when state changes between
complete. Presumably, inserting an iframe puts the tab to
loading state again.
You could see if
details.url is defined in
onUpdated listener - if not, you know that the document's URL did not change.
Perhaps you should use
webNavigation API instead for your purpose. There, you get a
TransitionQualifier that you can use to filter out subframe navigation.