snowcone-ltd / libmatoya

Cross-platform application development.
MIT License
592 stars 53 forks source link

Better escaping methodology for WebView on macOS #83

Closed dvijayak closed 1 year ago

dvijayak commented 1 year ago

Currently, text messages containing serialized JSON are sent incorrectly to the WebView. This PR fixes this by escaping the escape character '\' on all such strings. I have tested that this works on strings ranging from simple strings to multiple layers of JSON serialized strings.

Scratch the above.

Message passing is now done as base64-encoded strings. This nicely avoids all character escaping woes. We will revisit this solution if the encoding/decoding overhead proves to be problematic.