0

I'm currently working on chrome extension and I'm dealing with a content injection problem.

In my extension when user clicks the button inside the popup, he has possibility to choose DIV from the webpage he's currently on and then he can return back to popup to choose options for that chosen DIV. The problem is that I can't force the popup to be open when user clicks outside it (actually I can with open popup console, but it's not a solution here) and the popup.html is reloading every time extension is shown to user.

So I came up with an idea that I can inject a popup into an iframe in the webpage to have control over it's behaviour but I found similar solutions only connected with chrome extensions based on react. Is it possible without any framework?

Any help would be greatly appreciated.

stuckatit
  • 23
  • 4
  • Yes, you can use the standard DOM in your content script, no need for React. There are lots of tutorials as this topic is really old. One thing specific to extensions is that you can put the UI inside an iframe that points to a html file exposed via [web_accessible_resources](https://developer.chrome.com/extensions/manifest/web_accessible_resources) ([example](https://stackoverflow.com/a/43457539/3959875)). – wOxxOm Sep 12 '20 at 14:50
  • Extensions have no dependence on JS frameworks like React. – charlietfl Sep 12 '20 at 14:57

0 Answers0