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

Spurious error in firefox when used with stripe.js #380

Open
jaredwindover opened this issue Sep 8, 2017 · 27 comments
Open

Spurious error in firefox when used with stripe.js #380

jaredwindover opened this issue Sep 8, 2017 · 27 comments
Labels

Comments

@jaredwindover
Copy link

I'm seeing the following error in firefox in the console when I have redux devtools enabled on a page that's including https://js.stripe.com/v3/, which comes with a fairly comprehensive Content Security Policy.

Content Security Policy: The page’s settings blocked the loading of a resource at self (“script-src https://js.stripe.com”). Source: !function(t){function __webpack_require_....

Everything seems to still be working, but it took me a while to track down what the actual interaction was. At least a clearer error when a resource's CSP is incompatible with redux devtools would be really helpful.

@fred-stripe
Copy link

Just going to chime in here: I believe that this issue is because the iframe that Stripe.js uses for communications has a CSP that forbids self and unsafe-inline. Using redux-devtools in Chrome I don't get any errors, so it seems the Firefox extension is doing something different here; injecting a script maybe?

@fred-stripe
Copy link

Oh, I forgot to add! You can easily test this by visiting this page in Firefox with the extension enabled:

https://stripe.com/docs/elements/

@clarkbw
Copy link

clarkbw commented Sep 13, 2017

Looking to @digitarald for this :)

@digitarald
Copy link

Maybe the CSP rules in extension and the site somehow clash. I filed an issue on the Firefox side: https://bugzilla.mozilla.org/show_bug.cgi?id=1400924

@digitarald
Copy link

Looks like this is a long standing bug with Firefox being too strict with CSP and applying the rules as well on scripts injected by extensions & bookmarklets.

@archae0pteryx
Copy link

Is there any sort of resolution here?

@tommym9
Copy link

tommym9 commented Mar 22, 2018

Bump

@digitarald
Copy link

Re-bumped the security team to give some input, so far the bug did not get traction.

@luskin
Copy link

luskin commented Apr 4, 2018

Same on both firefox and chrome

@devinceble
Copy link

Also have this error +1

@jag1989
Copy link

jag1989 commented Jun 27, 2018

+1, Also have this with the LastPass extension

@morfie78
Copy link

morfie78 commented Jul 6, 2018

+1

1 similar comment
@manis404
Copy link

+1

@raymondTheDev
Copy link

Any update regarding this issue?

@digitarald
Copy link

Work is happening to make CSP work smarter for injected scripts. The bug is assigned and has patches but seems to be moving slowly. I will check in with the team to find out where this sits in their backlog.

@belonog
Copy link

belonog commented Sep 15, 2018

Also have this error +1

@zalmoxisus
Copy link
Collaborator

zalmoxisus commented Nov 29, 2018

I see the limitation is only for injecting from content script, but it's allowed to inject it from devtools panel script. The problem is that we need it to be done before the page is loaded, so we'll need to reload the page (probably adding a button for this case):

chrome.devtools.inspectedWindow.reload({ injectedScript: 'our page script here' })

I'll bring it to 3.0 version of the extension, since it would require a polling mechanism instead of the current messaging system.

@digitarald
Copy link

Just as an update from the Firefox side: The patch has a lot of traction lately and is being actively worked on, but I can't make any promises on a Firefox version yet as its a complicated problem space.

@zalmoxisus
Copy link
Collaborator

Thanks for keeping us updated!

I think this issue is not quite critical for our extension, it is mainly meant for development environment. It's nice to use it also in production to see the current state in case of any troubles, but one could just export lifted state (store.liftedStore.getState() in case of including instrumentation) or history of actions (redux-remotedev does that) from there and import in development environment with more tools and less limitations, the extension will recompute the exact state.

@pr0con
Copy link

pr0con commented Sep 27, 2019

Still going strong in 2019

@elgin9507
Copy link

I have the same problem in Firefox browser. But, despite this error, everything is working fine.

@web-surfer
Copy link

Still an issue on Firefox.

@iumyidol
Copy link

iumyidol commented Nov 1, 2021

and its still an issue today

@reduxjs reduxjs deleted a comment from guiklimek Nov 19, 2021
@reduxjs reduxjs deleted a comment from sagzy Nov 23, 2021
@markerikson
Copy link

Folks, nothing has changed with this. You don't need to keep adding comments saying "still an issue".

If there is an actual potential technical solution, the best thing you can do would be to file a PR that implements it. (It's also possible this is fixed in the upcoming DevTools Extension 3.0 version, which is currently in beta - it would help if someone could try it out and actually report on whether that might fix the problem.)

But otherwise, just adding a "still broken" comment is not helpful.

@chrisbward
Copy link

Fighting CSP has been the bane of my career and this issue has defeated me. Seppuku time lol

@CmpHDL
Copy link

CmpHDL commented Mar 8, 2023

+1

Folks, nothing has changed with this. You don't need to keep adding comments saying "still an issue".

If there is an actual potential technical solution, the best thing you can do would be to file a PR that implements it. (It's also possible this is fixed in the upcoming DevTools Extension 3.0 version, which is currently in beta - it would help if someone could try it out and actually report on whether that might fix the problem.)

But otherwise, just adding a "still broken" comment is not helpful.

It shows other people have the same issue and that it is a common problem among developers rather than an individual's problem.

@GaddMaster
Copy link

Folks, nothing has changed with this. You don't need to keep adding comments saying "still an issue".

If there is an actual potential technical solution, the best thing you can do would be to file a PR that implements it. (It's also possible this is fixed in the upcoming DevTools Extension 3.0 version, which is currently in beta - it would help if someone could try it out and actually report on whether that might fix the problem.)

But otherwise, just adding a "still broken" comment is not helpful.

still an issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests