Hi! I'm using Tauri v2 and have a WebView with an external URL. This worked fine with injecting scripts and calling to rust when I was previously on v1, but I recently switched to a fork of the feat/multiwebview branch to allow a separate titlebar/content WebView. This worked perfectly, except now I'm getting CSP errors like the following when using any window.__TAURI__ API:
Refused to connect to 'http://ipc.localhost/plugin%3Aevent%7Cemit' because it violates the document's Content Security Policy.
I doubt this is a result of me using the multi WebView features -- it makes sense that the CSP would prevent fetching these scripts, but something must have changed in v2.
My question is weather there's any way for me to fix this; I'm already using a fork, so I don't mind making tweaks to Tauri itself for now; I just want something that works. Could I either:
- Disable CSP altogether; this isn't a good solution on the security side of things, but if it's the only solution, it's okay to me.
- Modify the CSP of every response to allow
ipc.localhost; this sounds difficult, and wouldn't work by default usingon_web_resource_requestsince it only handlestauri://requests. Maybe I could change that? I recall reading that it's impossible to intercept and change http or https requests on MacOS, but I can't find where I saw that. - Somehow change how this communication is done to not require web requests; this sounds unfeasible.
I would need it to work on Windows and MacOS. I'm sorry if I'm overlooking something. Thank you!