NekitCorp / chrome-extension-svelte-typescript-boilerplate

Boilerplate for Chrome Extension Svelte Typescript project
237 stars 50 forks source link

How to add content scripts to dist without using manifest.json #26

Closed pyoner closed 8 months ago

pyoner commented 8 months ago

I want to use chrome.scripting.executeScript to execute content scripts.

How to add path of content scripts?

NekitCorp commented 8 months ago

Can this help you?

https://github.com/NekitCorp/chrome-extension-svelte-typescript-boilerplate/discussions/24

pyoner commented 8 months ago

Can this help you?

24

@NekitCorp thanks, it works for me.

import injectProgrammatically from "../content/inject-programmatically?script";

what Vite plugin does this?

NekitCorp commented 8 months ago

what Vite plugin does this?

CRXJS Vite Plugin

You can read more about it here: https://dev.to/jacksteamdev/advanced-config-for-rpce-3966#dynamic-content-scripts

pyoner commented 8 months ago

@NekitCorp thanks a lot!