How to inject script through chrome.tabs.executeScript every time I select a tab or open a new one ?
My main goal is whenever i create a new tab or click to select one already created i want to inject a javascript on the opened page. This extension needs to inject this script because i use some functions who only exists inside thescript.js.
I know i can inject my file using the code below, but i dont know how to trigger the event i said. Soo which event should i use for this use case ?
chrome.tabs.executeScript({ file: 'script.js' });