MicrosoftEdge / MicrosoftEdge/WebView2Feedback

[Problem/Bug]: Ignore csp rules for specific domains

Open
#4,379 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

What happened?

I have an app which uses webview2 and it opens external website (github.com).
From that page I also call my backend using custom protocol (with tauri)
The problem is that I call my custom protocol using fetch, and it throws the following error:

fetch('http://ipc.localhost')
Refused to connect to 'http://ipc.localhost' because it violates the document's Content Security Policy.

So my question is, if there's a way to disable csp?
and even better, if there's a way to ignore csp protection only for ipc.localhost

I tried to pass additional browser args: --disable-web-security and I still got the same errors.

Importance

Blocking. My app's basic functions are not working due to this issue.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

121.0.2277.112

SDK Version

No response

Framework

Other

Operating System

Windows 11

OS Version

10.0.22631 X64

Repro steps

Create simple webview2 app (simply with Tauri), navigate to external website eg. github.com,
then try to fetch ipc.localhost (custom protocol)

Repros in Edge Browser

Not Applicable

Regression

No, this never worked

Last working version (if regression)

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the minimal Tauri/WebView2 reproduction described in the issue: navigate to github.com and run the fetch request to ipc.localhost. Investigate how the external page's Content Security Policy applies to the custom protocol and whether WebView2 exposes a supported per-domain exception; done means a confirmed configuration or a documented limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, tauri
Domain
desktop, security
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.