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

why using an iframe when in "inject" mode? #95

Open
zivl opened this issue Jun 3, 2018 · 3 comments
Open

why using an iframe when in "inject" mode? #95

zivl opened this issue Jun 3, 2018 · 3 comments

Comments

@zivl
Copy link

zivl commented Jun 3, 2018

When I'm using inject mode I see there's a iframe that is responsible for loading the bundle.js file. Why can't I import the <Root /> (or something similar...) and use it inside <Dock> component?

It adds a lot of headaches to use iframe for modules I have locally... all communication between the tabs and iframe need to go through postMessage and etc.

Cheers,

@yjiq150
Copy link

yjiq150 commented Jul 15, 2018

Check this out. You can run React component without iframe.
https://github.com/yjiq150/react-chrome-extension-boilerplate

I just made a PR for the same problem today here.
#98

@zivl
Copy link
Author

zivl commented Jul 17, 2018

@yjiq150 can you explain here in a few words why/how did you walk-around it? why upgrading webpack solved this issue?

@yjiq150
Copy link

yjiq150 commented Jul 17, 2018

Actually it not related to webpack version. I bumped up the version while fixing inject problem.

To inject react component into the context of page, please refer here. I added some notes in there.

https://github.com/yjiq150/react-chrome-extension-boilerplate/blob/master/chrome/extension/content.js

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