I am writing this article for people who are like me, beginners and non-tech experts, so I am highlighting the steps that worked for me after struggling with it for some time. When the webview stopped working for me, I was upset, so what you see below is a collection of what I have found:
Problem Description
When using Firebase Studio or Google Cloud Workstations with VS Code in the browser, you may encounter this error:
```
Error loading webview: Error: Could not register service worker: SecurityError:
Failed to register a ServiceWorker: The provided scriptURL
(‘https://…cloudworkstations.googleusercontent.com/…/service-worker.js’)
violates the Content Security Policy.
```
Note: You might not face this issue when you first start your project, even while having your anti-virus active. For me, it started after a week or so
Root Cause
Kaspersky antivirus (version 2025) blocks service worker registration in Cloud Workstations due to:
- SSL/HTTPS traffic interception
- Content Security Policy header injection
- Script injection into web traffic
- Encrypted connection scanning
Solution
If you have Kaspersky Standard, Plus, Premium, or Small Office Security installed, follow these steps:
For me I was using Premium
Step 1: Configure Addresses to be Trusted
- Open Kaspersky → Click Settings icon (gear)
- Go to Security settings
- Click Network Settings
- Click Configure Trusted Addresses
- Click Add and enter each of these domains:
- `*.cloudworkstations.googleusercontent.com`
- `*.cloudworkstations.dev`
- `*.firebaseapp.com`
- `*.firebase.com`
- Click OK → Save
Step 2: Restart Browser
- Completely close your browser (all tabs and windows)
- Clear browser cache (optional but recommended)
- Reopen your Cloud Workstation
Verification
After completing these steps, the service worker error should be resolved, and VS Code extensions/webviews should load normally in your Cloud Workstation.
Alternative Quick Test
To confirm Kaspersky is causing the issue:
- Temporarily pause Kaspersky protection (5 minutes)
- Reload your Cloud Workstation
- If the error disappears, Kaspersky is confirmed as the cause
- Re-enable protection and apply the exclusions above
Additional Notes
- This issue affects other cloud development environments too (GitHub Codespaces, Gitpod, etc.)
- Do not disable your antivirus completely - use exclusions instead
- The wildcard `*` ensures all subdomains are covered
- Kaspersky’s SSL certificate interception breaks WebSocket connections required by Cloud Workstations
Related Issues
This solution could also fix the following:
- Extension installation failures
- WebSocket connection error
Tested with:
- Kaspersky Standard/Plus/Premium 2025
- Google Cloud Workstations
- Firebase Studio
- Chrome
Hope this helps others experiencing the same issue!
And if there was any mistake in my post, let me know, please