-
Notifications
You must be signed in to change notification settings - Fork 50
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
unsafe-eval in dev #48
Comments
upon closer inspection, it looks like the Is there a way to fix this? up to & including disabling hot-reload on https? |
Seems like in the last versions of Chrome were added some restrictions for inlining scripts in the extension, so we cannot inject Redux DevTools Extension anymore. Using the For now you can just comment these two lines. |
A possible solution would be to eval the Redux DevTools code, same as for the injected script: const httpRequest = new XMLHttpRequest();
httpRequest.open('GET', 'chrome-extension://lmhkpmbekcpmknklioeibfkpmmfibljd/js/redux-devtools-extension.js');
httpRequest.send();
httpRequest.onreadystatechange = function () {
if (httpRequest.readyState === XMLHttpRequest.DONE && httpRequest.status === 200) {
eval(httpRequest.responseText);
}
}; It would work in our case because the store is created asynchronously. But for most of other cases it will be executed after the store is created, thus DevTools enhancer will not be applied. |
Thinking over, the best option would be to use @jhen0409 what do you think? If you agree, I'll add a deprecation warning in |
Yeah it's breaking the boilerplate now. I agreed for use |
I just added
crossbuilder
in a nested folder in another of my repositories (so it uses parentbabelrc
,eslintrc
,etc.), so this problem could be related to my specific config, but wanted to share anyway.When loading the extension and inspecting the
background
console, I get this error:As the warning advises, I added the
hash
tomanifest.dev.json
, and it actually works fine (adding theunsafe-inline
threw an error).Is this a suitable solution? I thought the
hash
was a hash of the actual inline script, but when I make small modifications to theCounter
component, the extension still injects it fine, so I assume I'm missing something.The text was updated successfully, but these errors were encountered: