chromium / suspicious-site-reporter

Extension for reporting suspicious sites to Safe Browsing.
Apache License 2.0
96 stars 22 forks source link

chrome.tabs.onActivated can suggest a tab that cannot be found #41

Open ericlaw1979 opened 5 years ago

ericlaw1979 commented 5 years ago

v1.18

This plainly shouldn't be possible, but it appears that the OnActivated event can return activeTabInfo that does not match a tab that chrome.tabs.get can find. When that happens, setBrowserActionAndIcon throws an error.

image

I suppose we could bail fast inside setBrowserActionAndIcon if the tab is undefined, but it's not clear what state that will end up leaving the toolbar button in. But trying to change the toolbar button to disabled would require that we have a legitimate active TabID...