Skip to content

Commit 6a14070

Browse files
committed
Add faq entry about web views
Closes #5671.
1 parent a9eb923 commit 6a14070

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/FAQ.md

+20
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
- [How do I hide the coder/coder promotion in Help: Getting Started?](#how-do-i-hide-the-codercoder-promotion-in-help-getting-started)
3838
- [How do I disable the proxy?](#how-do-i-disable-the-proxy)
3939
- [How do I disable file download?](#how-do-i-disable-file-download)
40+
- [Why do web views not work?](#why-do-web-views-not-work)
4041

4142
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
4243
<!-- prettier-ignore-end -->
@@ -487,3 +488,22 @@ when using the option.
487488
## How do I disable file download?
488489

489490
You can pass the flag `--disable-file-downloads` to `code-server`
491+
492+
## Why do web views not work?
493+
494+
Web views rely on service workers, and service workers are only available in a
495+
secure context, so most likely the answer is that you are using an insecure
496+
context (for example an IP address).
497+
498+
If this happens, in the browser log you will see something like:
499+
500+
> 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..
501+
502+
To fix this, you must either:
503+
504+
- Access over localhost/127.0.0.1 which is always considered secure.
505+
- Use a domain with a real certificate (for example with Let's Encrypt).
506+
- Use a trusted self-signed certificate with [mkcert](https://mkcert.dev) (or
507+
create and trust a certificate manually).
508+
- Disable security if your browser allows it. For example, in Chromium see
509+
`chrome://flags/#unsafely-treat-insecure-origin-as-secure`

0 commit comments

Comments
 (0)