Fixed Qt provider
* postData => postMessage * JSON.parse parsed wrong data on 'onmessage'
This commit is contained in:
parent
aca9a41fcf
commit
5538ff7252
4
qt.js
4
qt.js
@ -5,13 +5,13 @@
|
|||||||
var self = this;
|
var self = this;
|
||||||
navigator.qt.onmessage = function (message) {
|
navigator.qt.onmessage = function (message) {
|
||||||
self.handlers.forEach(function (handler) {
|
self.handlers.forEach(function (handler) {
|
||||||
handler.call(self, JSON.parse(message));
|
handler.call(self, JSON.parse(message.data));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
QtProvider.prototype.send = function(payload) {
|
QtProvider.prototype.send = function(payload) {
|
||||||
navigator.qt.postData(JSON.stringify(payload));
|
navigator.qt.postMessage(JSON.stringify(payload));
|
||||||
};
|
};
|
||||||
|
|
||||||
Object.defineProperty(QtProvider.prototype, "onmessage", {
|
Object.defineProperty(QtProvider.prototype, "onmessage", {
|
||||||
|
Loading…
Reference in New Issue
Block a user