Some JavaScript frameworks use a prototype toJSON function, can incorrectly wrap quotes around JSON objects, completely breaking the QZ Tray application.
The recommendation is to force the explicit use of the browser's JSON.stringify, which may involve temporarily reassigning the prototyped versions in js/qz-websocket.js#L109 just prior to use.
delete Array.prototype.toJSON
var msg = JSON.stringify(objMsg);
or
var tmp = Array.prototype.toJSON;
delete Array.prototype.toJSON;
var msg = JSON.stringify(objMsg);
Array.prototype.toJSON = tmp;
Some JavaScript frameworks use a prototype
toJSON
function, can incorrectly wrap quotes around JSON objects, completely breaking the QZ Tray application.Becomes this:
Better explained here: http://stackoverflow.com/questions/710586/json-stringify-array-bizarreness-with-prototype-js
The recommendation is to force the explicit use of the browser's JSON.stringify, which may involve temporarily reassigning the prototyped versions in
js/qz-websocket.js#L109
just prior to use.or