Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple content scripts #34

Open
djgrant opened this issue Oct 18, 2021 · 4 comments
Open

Multiple content scripts #34

djgrant opened this issue Oct 18, 2021 · 4 comments

Comments

@djgrant
Copy link

djgrant commented Oct 18, 2021

Would it be possible to create multiple content scripts?

The use case is needing different permissions on different scripts e.g. one content script is used for post-installation, another for logging a user in, another for the general functionality of the page.

Happy to raise a PR, with some direction

@dim0147
Copy link

dim0147 commented Oct 25, 2021

You can try creating a new folder like contentScript folder with the index.js file, then run yarn eject or npm run eject and set up a little in the config to create a new JavaScript file when development and build

@djgrant
Copy link
Author

djgrant commented Oct 27, 2021

Ejecting is certainly an option, but best avoided where possible. Especially in common use-cases like this, where other users would also benefit from it being implemented in core.

@dim0147
Copy link

dim0147 commented Oct 27, 2021

Currently, there is no way to add new a new file in the build or devevlopment because all the files and folders are hardcode in config with need to eject to see

@djgrant
Copy link
Author

djgrant commented Oct 27, 2021

Yes, I'm aware it's not possible right now. I'm suggesting it be a feature of CRE and am happy to create a PR if the author would like to see it implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants