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

Create a button in react using javascript that can run and inject a local script into a webpage #5

Open
ThoradTM opened this issue Mar 9, 2023 · 1 comment
Assignees

Comments

@ThoradTM
Copy link
Collaborator

ThoradTM commented Mar 9, 2023

No description provided.

@ThoradTM
Copy link
Collaborator Author

Your button needs to be able to inject a local script in the base directory, say content_script.js, into the webpage that is currently focused in the browser when the button is pressed.

https://developer.chrome.com/docs/extensions/mv3/content_scripts/

This documentation should help you. I want this to be a button instead of it being selected by URL in the manifest.json because I don't think we want a schedule auto generating automatically when you load my mav (or for the script to break). The implementation will change long term, but for now this is the plan.

If react can't work you can try to use pure HTML and javascript, although getting that to work with react my be frustrating)
https://github.com/MaximeKjaer/programmatic-injection-template
Here is an example of a working implementation outside of react. Much luck!

@ThoradTM ThoradTM self-assigned this Apr 2, 2023
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

1 participant