diff options
author | obscuren <geffobscura@gmail.com> | 2014-10-21 06:26:34 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-10-21 06:26:34 +0800 |
commit | 76b20be2ea0b95bf700b36df39a5678f8ba7fcc1 (patch) | |
tree | 51575281350d8e1b422f2c659c8ad68e2e1c05f6 | |
parent | 74cab14b8d208d8c822eb6a1cbea8a9e6cffb544 (diff) | |
download | go-tangerine-76b20be2ea0b95bf700b36df39a5678f8ba7fcc1.tar go-tangerine-76b20be2ea0b95bf700b36df39a5678f8ba7fcc1.tar.gz go-tangerine-76b20be2ea0b95bf700b36df39a5678f8ba7fcc1.tar.bz2 go-tangerine-76b20be2ea0b95bf700b36df39a5678f8ba7fcc1.tar.lz go-tangerine-76b20be2ea0b95bf700b36df39a5678f8ba7fcc1.tar.xz go-tangerine-76b20be2ea0b95bf700b36df39a5678f8ba7fcc1.tar.zst go-tangerine-76b20be2ea0b95bf700b36df39a5678f8ba7fcc1.zip |
Qt provider
-rw-r--r-- | qt.js | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -0,0 +1,15 @@ +(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.QtProvider = QtProvider; + } +})(); |