Fixed setting providers to the right object

This commit is contained in:
obscuren
2014-10-21 00:37:58 +02:00
parent 76b20be2ea
commit 8a7d1a69b3
3 changed files with 9 additions and 4 deletions

4
qt.js
View File

@@ -3,6 +3,7 @@
QtProvider.prototype.send = function(payload) {
navigator.qt.postData(JSON.stringify(payload));
};
Object.defineProperty(QtProvider.prototype, "onmessage", {
set: function(handler) {
navigator.qt.onmessage = handler;
@@ -10,6 +11,7 @@
});
if(typeof(web3) !== "undefined" && web3.providers !== undefined) {
web3.QtProvider = QtProvider;
web3.providers.QtProvider = QtProvider;
}
})();