Google Colaboratory ServiceWorker Error On Chrome

2020-04-02 08:58发布

问题:

Whenever I open a Colaboratory Document I always get the same error message:

NotSupportedError: Failed to register a ServiceWorker: The user denied permission to use Service Worker.

This is happening on chrome and my browser allows for ServiceWorkers (chrome://serviceworker-internals/), what's going on? Because the thing is all the code still runs.

回答1:

Colab's output frames use service workers to support some functionality such as displaying richer graphs (Altair and Plot.ly).

The error message indicates that third-party cookies are disabled in your browser, this will prevent the browser service workers from working. The option should be configured under chrome://settings/content/cookies.



回答2:

I tried white-listing in chrome link (chrome://settings/content/cookies) the following:

https://[*.]googleusercontent.com:443
[*.]colab.research.google.com

Here it was the best approach, better than simply liberatin the 3rd part cookies Seems to work so on.



回答3:

Usually there are two causes for this error:

1- you didn't allow cookies on colab domain, so you need to change you browser settings

2- you are using an adblocker