In the native-messaging API, where it reads in the documentation that
Each message is serialized using JSON, UTF-8 encoded and is preceded with a 32-bit value containing the message length in native byte order.
is it guaranteed that the JSON string passed from the browser to the native application will never have white space?
The native application is coded in C which doesn’t have an equivalent of JSON parse and, likely, the SQLite3 JSON1 extension will handle the JSON operations needed for storing/updating data but I recently learned that they work only within the SQLite3 APIs and are not available to the general C code. I’d like to place a property at the beginning of the JSON string indicating the requested operation in C and would like to know if I can count on it always being in the same position.
When I test this by writing the message recieved from the browser to a text file on the local disk, there are no white spaces. Will that always be the case and/or can I do something within the extension to ensure that the JSON string will either always have or not have white space around the delimiters?
Otherwise, I suppose I could just read each character starting from the beginning until I read the property and then its value, ignoring all white spaces.