"The user denied permission to use Service Worker." when using codespaces

I’m still experiencing the error reported in September 2020 with the permission error -

The permissions do seem to be blocked, but I didn’t do it on purpose. Furthermore, even allowing them once doesn’t really work because the URL of the service worker changes every time.

How to fix?

I am also getting this error. For me, it’s when trying to use Markdown: Open Preview command. I tried allowing the cookie manually through the GUI on Brave, but after refreshing the page I kept seeing the same issue.

Edit: I have just run into the same error again when trying to display the Create Pull Request panel for the GitHub Pull Request extension.

I am getting the same error using Brave. I tried turning off all the shields but still got the error.

Error loading webview: Error: Could not register service workers: NotSupportedError: Failed to register a ServiceWorker for scope
('https://21b296a2-9664-475d-8387-f0fb4fef5697.vscode-webview.net/stable/3866c3553be8b268c8a7f8c0482c0c0177aa8bfa/out/vs/workbench/contrib/webview/browser/pre/') with script ('https://21b296a2-9664-475d-8387-f0fb4fef5697.vscode-webview.net/stable/3866c3553be8b268c8a7f8c0482c0c0177aa8bfa/out/vs/workbench/contrib/webview/browser/pre/service-worker.js?id=21b296a2-9664-475d-8387-f0fb4fef5697&swVersion=2&extensionId=vscode.markdown-language-features&platform=browser&vscode-resource-base-authority=vscode-resource.vscode-webview.net'):
The user denied permission to use Service Worker..

Most probably you as me have “Block third-party cookies” setting enabled. I was able to workaround the error by adding [*.]github.dev to “Sites that can always use cookies” with a checkbox “Including third-party cookies on this site” selected.