plugeth/qt.js
2014-10-21 00:37:58 +02:00

18 lines
461 B
JavaScript

(function() {
var QtProvider = function() {};
QtProvider.prototype.send = function(payload) {
navigator.qt.postData(JSON.stringify(payload));
};
Object.defineProperty(QtProvider.prototype, "onmessage", {
set: function(handler) {
navigator.qt.onmessage = handler;
},
});
if(typeof(web3) !== "undefined" && web3.providers !== undefined) {
web3.providers.QtProvider = QtProvider;
}
})();