aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-10-21 06:26:34 +0800
committerobscuren <geffobscura@gmail.com>2014-10-21 06:26:34 +0800
commit76b20be2ea0b95bf700b36df39a5678f8ba7fcc1 (patch)
tree51575281350d8e1b422f2c659c8ad68e2e1c05f6
parent74cab14b8d208d8c822eb6a1cbea8a9e6cffb544 (diff)
downloadgo-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.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/qt.js b/qt.js
new file mode 100644
index 000000000..214a0ee23
--- /dev/null
+++ b/qt.js
@@ -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;
+ }
+})();