Whenever the chrome.tabs.onUpdated() is fired in the background script, another "instance" of the content script is added to the respected tab.
If the content script is properly encapsulated (so that it couldn't be modified from the outside by third party scripts), the different instances will not be aware of eachother.
They will find the same audio elements and they will try filter them, however, one actual audio element could only connect to a single media element source. The first content scritp instance will do this, the rest will fail.
The content script should only be injected once and instead, it should be notified to "search again".
Whenever the
chrome.tabs.onUpdated()
is fired in the background script, another "instance" of the content script is added to the respected tab. If the content script is properly encapsulated (so that it couldn't be modified from the outside by third party scripts), the different instances will not be aware of eachother. They will find the same audio elements and they will try filter them, however, one actual audio element could only connect to a single media element source. The first content scritp instance will do this, the rest will fail. The content script should only be injected once and instead, it should be notified to "search again".