Add faq entry about web views

Closes #5671.
This commit is contained in:
Asher 2024-07-11 11:49:56 -08:00
parent a9eb923790
commit 6a14070664
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A
1 changed files with 20 additions and 0 deletions

View File

@ -37,6 +37,7 @@
- [How do I hide the coder/coder promotion in Help: Getting Started?](#how-do-i-hide-the-codercoder-promotion-in-help-getting-started) - [How do I hide the coder/coder promotion in Help: Getting Started?](#how-do-i-hide-the-codercoder-promotion-in-help-getting-started)
- [How do I disable the proxy?](#how-do-i-disable-the-proxy) - [How do I disable the proxy?](#how-do-i-disable-the-proxy)
- [How do I disable file download?](#how-do-i-disable-file-download) - [How do I disable file download?](#how-do-i-disable-file-download)
- [Why do web views not work?](#why-do-web-views-not-work)
<!-- END doctoc generated TOC please keep comment here to allow auto update --> <!-- END doctoc generated TOC please keep comment here to allow auto update -->
<!-- prettier-ignore-end --> <!-- prettier-ignore-end -->
@ -487,3 +488,22 @@ when using the option.
## How do I disable file download? ## How do I disable file download?
You can pass the flag `--disable-file-downloads` to `code-server` You can pass the flag `--disable-file-downloads` to `code-server`
## Why do web views not work?
Web views rely on service workers, and service workers are only available in a
secure context, so most likely the answer is that you are using an insecure
context (for example an IP address).
If this happens, in the browser log you will see something like:
> Error loading webview: Error: Could not register service workers: SecurityError: Failed to register a ServiceWorker for scope with script: An SSL certificate error occurred when fetching the script..
To fix this, you must either:
- Access over localhost/127.0.0.1 which is always considered secure.
- Use a domain with a real certificate (for example with Let's Encrypt).
- Use a trusted self-signed certificate with [mkcert](https://mkcert.dev) (or
create and trust a certificate manually).
- Disable security if your browser allows it. For example, in Chromium see
`chrome://flags/#unsafely-treat-insecure-origin-as-secure`