aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/lib')
-rw-r--r--app/scripts/lib/extension-instance.js25
-rw-r--r--app/scripts/lib/remote-store.js2
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