redux-devtools-extension icon indicating copy to clipboard operation
redux-devtools-extension copied to clipboard

CSP Error

Open ValeryVS opened this issue 6 years ago • 4 comments

OS X Firefox

With redux devtools enabled, I have CSP error in Firefox. Chrome extension works.

Content Security Policy: Параметры страницы заблокировали загрузку ресурса self («script-src»). Source: !function(t){function _webpack_require....

https://market.yandex.ru/

ValeryVS avatar Aug 06 '18 11:08 ValeryVS

Probably related https://github.com/zalmoxisus/redux-devtools-extension/issues/411

ValeryVS avatar Aug 06 '18 11:08 ValeryVS

It's related to https://bugzilla.mozilla.org/show_bug.cgi?id=1267027.

Some workarounds other extensions are exploring:

  • https://github.com/gorhill/uBlock/issues/2823
  • https://github.com/EFForg/privacybadger/issues/1793
  • https://github.com/MyCryptoHQ/MyCrypto/issues/2061#issuecomment-405701072
  • https://github.com/violentmonkey/violentmonkey/issues/173

Another workaround is to include extension's injected script in our npm package, so you can include it directly for such cases.

zalmoxisus avatar Nov 17 '18 13:11 zalmoxisus

I looked through the workarounds in the issues above, none suits our usecase. We cannot include clients scripts in the extension like ublock does, and providing a sha-code to be added on the client side would be the same as including the script from npm.

However, I see we still can inject the script from devpanel. 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' })

This should go with our new pooling method planned for 3.0.

zalmoxisus avatar Nov 25 '18 16:11 zalmoxisus

Hey @zalmoxisus, may I ask if there's any possible solution to get rid of that error in the logs as of today? It's a shame Firefox display CSP issues from extensions as it can get in the way of development sometimes. Thanks in advance.

zanona avatar Nov 25 '20 13:11 zanona