Closed robertcoopercode closed 5 years ago
Sorry. This is the first I've seen or heard of this. 😦
Do you have "Block third-party cookies and site data" checked in Chrome's "Content Settings" ?
Related https://github.com/apollographql/apollo-client-devtools/pull/185/files
Chrome extensions will fail to access
window.localStorage
if 3rd party cookies are blocked.
Looks like the Apollo DevTools replaced window.localStorage
with a wrapper around chrome.storage.local
. We could do that here, except that localStorage
is used in the injected renderer to support reload-and-profile:
Maybe we could add an abstraction that used both localStorage
and chrome.storage.local
(depending on the context) and wrapped localStorage
access with try
/catch
blocks in case it's not supported. This would mean that some features wouldn't work at all (e.g. reload and profile) in restricted contexts but at least others would.
Do you have "Block third-party cookies and site data" checked in Chrome's "Content Settings" ?
Yes. I unchecked it and now the extension loads correctly! Thanks a lot 💯
Good to know. Thanks for the report. I'll try to see that it degrades more gracefully in this case.
After thinking about this more, I believe it's a Chrome bug. Disabling cookies for a website shouldn't disable the localStorage
API for an extension, given that those two contexts are separate.
Unfortunately it looks like this has been reported to Chrome before, without any action being taken:
I think working around it by using (the asynchronous) chrome.storage
API is pretty tricky, because of timing issues during initialization. At best we would have to completely drop support for the "reload and profile" feature. It would also make user settings in more complicated in general, particularly component filters.
For now, I've filed a new crbug (since the above two have been closed):
For now I have at least fixed the runtime error by wrapping all calls to localStorage
/sessionStorage
in try
/catch
so the extension doesn't fail. (71bfb34)
Should be able to install the latest to get this fix. Going to close this issue in our repo for now, since I don't plan to act on it further (at least not yet, pending more info on the crbug).
Hope this works for you. It worked for me
Hi, trying to do this on the browserless chrome image. https://hub.docker.com/r/browserless/chrome/
Any idea how I unset the "block third party cookies and site data" setting in cli mode?
cheers, Ben
Nope, sorry. You'll have to search the Chrome docs.
When installing the extension, I get an error for the Chrome extension that says the following:
This error is preventing the React tabs from showing up in the Chrome Devtools for me.
Chrome Version 74.0.3729.169
Feel free to close if you have no idea.