Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add option to force v1 postMessage ipc protocol #8887

Closed

Conversation

thewh1teagle
Copy link
Contributor

@thewh1teagle thewh1teagle commented Feb 18, 2024

It's important to have the ability to control whether to use the old IPC protocol or the newer one. For instance, because the new method uses fetch, we have issues like #8476.

So, I added the ability to force using the v1 postMessage IPC protocol by activating the force-ipc-v1-protocol feature in the Tauri dependency.

I tested it on MacOS / Windows both when activated and not, and it works.
Also it solved for me the CSP issues in windows.

https://discord.com/channels/616186924390023171/1201542436040757248

Update

Looks like it doesn't work on Windows when returning JSON value from rust, checking it. (it works with strings)

Update1

Solved in second commit. need review

@thewh1teagle thewh1teagle requested a review from a team as a code owner February 18, 2024 13:38
@lucasfernog
Copy link
Member

I think this should be resolved at runtime instead, so you can have both the v1 and the v2 IPC implementations if you app use both local and remote URLs.

@thewh1teagle
Copy link
Contributor Author

thewh1teagle commented Feb 18, 2024

@lucasfernog

I think it might be much better to handle it at runtime / per webview.
Do you have any ideas for a convenient interface or examples that we could follow?

@lucasfernog
Copy link
Member

After investigating this I believe it's easier to handle the CSP issue at the IPC layer instead of letting the user to configure it (with is a lot more complicated). I'll open a PR soon.

Thank you for this PR though, you've done a great job investigating the problem and finding a solution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants