diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2016-07-27 14:32:12 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2016-07-27 14:32:12 +0800 |
commit | cf14eb4043865e26e13009f813b71f80203bf847 (patch) | |
tree | db1a4511ff4dab29c82940965223002202336bc6 /app/scripts/lib | |
parent | 3a4744dec179d0845cd9a3c306a6318dd609f4bd (diff) | |
parent | 7a8d0497324f6f05274e7ffeef828134cbf9c481 (diff) | |
download | tangerine-wallet-browser-cf14eb4043865e26e13009f813b71f80203bf847.tar tangerine-wallet-browser-cf14eb4043865e26e13009f813b71f80203bf847.tar.gz tangerine-wallet-browser-cf14eb4043865e26e13009f813b71f80203bf847.tar.bz2 tangerine-wallet-browser-cf14eb4043865e26e13009f813b71f80203bf847.tar.lz tangerine-wallet-browser-cf14eb4043865e26e13009f813b71f80203bf847.tar.xz tangerine-wallet-browser-cf14eb4043865e26e13009f813b71f80203bf847.tar.zst tangerine-wallet-browser-cf14eb4043865e26e13009f813b71f80203bf847.zip |
Merge branch 'master' into droppo-fix
Diffstat (limited to 'app/scripts/lib')
-rw-r--r-- | app/scripts/lib/extension-instance.js | 25 | ||||
-rw-r--r-- | app/scripts/lib/remote-store.js | 2 |
2 files changed, 20 insertions, 7 deletions
diff --git a/app/scripts/lib/extension-instance.js b/app/scripts/lib/extension-instance.js index eeab6c6d0..eb3b8a1e9 100644 --- a/app/scripts/lib/extension-instance.js +++ b/app/scripts/lib/extension-instance.js @@ -24,14 +24,27 @@ const apis = [ function Extension () { const _this = this - let global = window - - if (window.chrome) { - global = window.chrome - } apis.forEach(function (api) { - _this[api] = global[api] + + _this[api] = null + + try { + if (chrome[api]) { + _this[api] = chrome[api] + } + } catch (e) {} + + try { + if (window[api]) { + _this[api] = window[api] + } + } catch (e) {} + + try { + _this.api = browser.extension[api] + } catch (e) {} + }) } diff --git a/app/scripts/lib/remote-store.js b/app/scripts/lib/remote-store.js index fbfab7bad..c81d5151c 100644 --- a/app/scripts/lib/remote-store.js +++ b/app/scripts/lib/remote-store.js @@ -52,7 +52,7 @@ HostStore.prototype.set = function (key, value) { HostStore.prototype.createStream = function () { var dnode = Dnode({ - // update: this._didUpdate.bind(this), + update: this._didUpdate.bind(this), }) dnode.on('remote', this._didConnect.bind(this)) return dnode |