|
37 | 37 | - [How do I hide the coder/coder promotion in Help: Getting Started?](#how-do-i-hide-the-codercoder-promotion-in-help-getting-started)
|
38 | 38 | - [How do I disable the proxy?](#how-do-i-disable-the-proxy)
|
39 | 39 | - [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) |
40 | 41 |
|
41 | 42 | <!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
42 | 43 | <!-- prettier-ignore-end -->
|
@@ -487,3 +488,22 @@ when using the option.
|
487 | 488 | ## How do I disable file download?
|
488 | 489 |
|
489 | 490 | 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