react-chrome-extension | This project was bootstrapped with Create React | Frontend Framework library
kandi X-RAY | react-chrome-extension Summary
kandi X-RAY | react-chrome-extension Summary
This project was bootstrapped with Create React App.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of react-chrome-extension
react-chrome-extension Key Features
react-chrome-extension Examples and Code Snippets
Community Discussions
Trending Discussions on react-chrome-extension
QUESTION
I'm absolutly new to react and javascript and my problem is that the modal window which holds my react app, which is a chrome extension, gets injected to the DOM every time I click the extension-icon, resulting in strange rendering issues.
(The div with my modal window inside, gets added each time to the DOM when I click the icon).
Result looks like this:
modal Window injected multiple times after clicking icon multiple times
I would like to change it in a way that my component only gets added once to the DOM and on click should only hide/show.
My project is based on the following github project: https://github.com/upmostly/react-chrome-extension
I use the same manifest.json (you can find in public folder on the github link), the same background.js (also in public folder) and the same index.html (found in the src folder) as the project, I only changed the content of the React Components for my personal project.
I would be very happy to find some help here.
Best regards
Tobias
...ANSWER
Answered 2021-Jan-18 at 13:51thank you to wOxxOm, who gave me an idea on how to do it. I changed the call of the main function in content.js to:
QUESTION
I am trying to build a react chrome extension. I started off with the simple project found here. In its structure, the popup is contained in Modal.js and I would like to include an image in it which is contained in the project. However, to access that I must use chrome.runtime.getURL("image_file.png")
, which I cannot access in Modal.js, but only in content.js. How should I get the image properly to Modal.js?
This is all activated when the browser action button is pressed, which calls this function within content.js:
...ANSWER
Answered 2020-May-22 at 20:38Figured this out. I don't know if this is the best solution, but it is working for me.
Since I need to access chrome.runtime.getURL
I need to do that from the content script. But I need the value of that in my component which doesn't have access to the chrome api. So I message between them through window events. Here is some example code:
ExampleComponent.js
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install react-chrome-extension
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page