tshaddix / webext-redux

A set of utilities for building Redux applications in Web Extensions.
MIT License
1.22k stars 179 forks source link

iframe in Firefox: Uncaught (in promise) ReferenceError: browser is not defined #256

Open anotherstarburst opened 4 years ago

anotherstarburst commented 4 years ago

Hi @tshaddix

I love this project. I've been test driving it for an app and came across an issue I can't quite get to the bottom of. Hopefully you have a better feel for how to solve it?

What I expect to happen

I'm injecting an iframe into a page, and the content of said iframe is able to access the redux store.

What actually happens

This works as expected in Chrome, however when I run this in Firefox it throws the following error:

Uncaught (in promise) ReferenceError: browser is not defined

which links to https://github.com/tshaddix/webext-redux/blob/536e12689deea53c92ddffd8bdee15f733f0146b/src/util.js

Steps to reproduce

I've put together a simple web extension so you can reproduce the issue at your leisure: https://github.com/anotherstarburst/webext-redux-issue

Notes