Tell me, who has experience in developing extensions for Chrome, is it possible to limit the launch of content scripts to only the current active tab?

Those. The problem in general is as follows: when the extension is launched, a new tab has opened and there are many different links on it. When clicking on links (links open in the same tab), the extension menu is shown to the user. The question is how to implement it within the current active tab. I tried to add the myparam=1 parameter to all links and write the rule *://*/*myparam* into manifest.json, but if, for example, when following a link, a redirect occurs, then the parameter is lost. Therefore, there is an idea to allow all URLs, but limit all to one tab.

  • And what opens this tab? To do this, you must also have some kind of back-up script or some more global than content. Here, when opening the tab, let it tell the bacground (if it is not the bacground itself). And the bacground remembers the tab's id. Let the content script always start but at the very beginning it calls on the bacground and he will tell him whether he started the tab and whether he needs to work here - Mike
  • @Mike Thanks for the great advice. It turned out to be implemented by comparing in the background.js in chrome.tabs.onUpdated.addListener id of the open tab and the current active and if they are the same then send a message to content.js - Nikolay Novikov

0