dutiyesh / dutiyesh/chrome-extension-cli

How to config the webpack properly to include the contentscript js file via executeScript?

Open
#40 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.5k
Forks
105
PR merge metrics
No merged PRs in 30d

Description

For some reasons, i want to executeScript from the background.js
```
chrome.scripting.executeScript(
{
target: { tabId: aTab.id },
files: [
// get selection, send it to background (here), wait for response, replace selection
"/my_content_script.js"
]
});
```

However, in such a case, the `my_content_script.js` is not recognised by the webpack. I have to put it in `public` instead of `src`.

Any suggestion ? or just put into public ?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.