I am actuallyy trying to inject the content script by clicking on the icon of extension. so, kindly tell me how it will work, I tried with this code. but It throw error at this line
// note how the import path ends with `?script`importscriptPathfrom'./content-script?script'chrome.action.onClicked.addListener((tab)=>{chrome.scripting.executeScript({target:{tabId:tab.id},files:[scriptPath]});});
I checked, I did the same in maniest json. this code will work fine inside it?
I am actuallyy trying to inject the content script by clicking on the icon of extension. so, kindly tell me how it will work, I tried with this code. but It throw error at this line
You can import the script with a script query:
This will also provide HMR for the imported script. More info: Dynamic content scripts