2014-10-20 17:26:34 -05:00
|
|
|
(function() {
|
|
|
|
var QtProvider = function() {};
|
|
|
|
QtProvider.prototype.send = function(payload) {
|
|
|
|
navigator.qt.postData(JSON.stringify(payload));
|
|
|
|
};
|
2014-10-20 17:37:58 -05:00
|
|
|
|
2014-10-20 17:26:34 -05:00
|
|
|
Object.defineProperty(QtProvider.prototype, "onmessage", {
|
|
|
|
set: function(handler) {
|
|
|
|
navigator.qt.onmessage = handler;
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
if(typeof(web3) !== "undefined" && web3.providers !== undefined) {
|
2014-10-20 17:37:58 -05:00
|
|
|
web3.providers.QtProvider = QtProvider;
|
2014-10-20 17:26:34 -05:00
|
|
|
}
|
|
|
|
})();
|
2014-10-20 17:37:58 -05:00
|
|
|
|