syttunnel 0.1.5-7 → 0.1.5-8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/syttunnel.js +10 -3
package/package.json
CHANGED
package/syttunnel.js
CHANGED
|
@@ -429,9 +429,16 @@ var Bridge = /** @class */ (function () {
|
|
|
429
429
|
function Bridge() {
|
|
430
430
|
var _this = this;
|
|
431
431
|
this.onMessage = function (msg) {
|
|
432
|
-
var message =
|
|
433
|
-
|
|
434
|
-
|
|
432
|
+
var message = {};
|
|
433
|
+
if (msg.data && typeof msg.data === "string" && msg.data.length > 0) {
|
|
434
|
+
try {
|
|
435
|
+
message = JSON.parse(msg.data);
|
|
436
|
+
}
|
|
437
|
+
catch (error) { }
|
|
438
|
+
}
|
|
439
|
+
else if (msg.data) {
|
|
440
|
+
message = msg.data;
|
|
441
|
+
}
|
|
435
442
|
var method = message.method;
|
|
436
443
|
var value = message.value;
|
|
437
444
|
var uniqueId = message.uniqueId;
|