Passing an UnlistedScriptDefinition to injectScript
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10.5k
- Forks
- 564
- PR merge metrics
- No merged PRs in 30d
Description
Feature Request
It would be nice if the build system substituted the path of the script in the injectScript call as follows.
// main-injected.ts
export default defineUnlistedScript(/* ... */);
// isolated.content.ts
import mainInjected from "./main-injected";
export default defineContentScript({
matches: ["https://example.net/*"],
async main() {
await injectScript(mainInjected);
},
});
Thanks!
Is your feature request related to a bug?
N/A
What are the alternatives?
Keeping things as-is.
Additional context
N/A
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the build-system handling of the injectScript call and the UnlistedScriptDefinition returned by defineUnlistedScript; the issue does not name specific files or tests. Compare the main-injected.ts and isolated.content.ts examples, and consider the work complete when the build substitutes the script path for injectScript(mainInjected).
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100