aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-07-26 08:47:14 +0800
committerDan Finlay <dan@danfinlay.com>2016-07-26 08:47:14 +0800
commitb43b9f13e97258d6d546e62a2fd280b44045a610 (patch)
tree65ed2ac79ee1861f41aa177a75a25d71145cee66 /app/scripts/lib
parentbe74589f49bbe977f881b17a0383cafa4336d9b4 (diff)
downloadtangerine-wallet-browser-b43b9f13e97258d6d546e62a2fd280b44045a610.tar
tangerine-wallet-browser-b43b9f13e97258d6d546e62a2fd280b44045a610.tar.gz
tangerine-wallet-browser-b43b9f13e97258d6d546e62a2fd280b44045a610.tar.bz2
tangerine-wallet-browser-b43b9f13e97258d6d546e62a2fd280b44045a610.tar.lz
tangerine-wallet-browser-b43b9f13e97258d6d546e62a2fd280b44045a610.tar.xz
tangerine-wallet-browser-b43b9f13e97258d6d546e62a2fd280b44045a610.tar.zst
tangerine-wallet-browser-b43b9f13e97258d6d546e62a2fd280b44045a610.zip
Fix integration tests
Diffstat (limited to 'app/scripts/lib')
-rw-r--r--app/scripts/lib/extension-instance.js23
1 files changed, 19 insertions, 4 deletions
diff --git a/app/scripts/lib/extension-instance.js b/app/scripts/lib/extension-instance.js
index b9d0ed06d..eb3b8a1e9 100644
--- a/app/scripts/lib/extension-instance.js
+++ b/app/scripts/lib/extension-instance.js
@@ -26,10 +26,25 @@ function Extension () {
const _this = this
apis.forEach(function (api) {
- _this[api] = chrome !== undefined && chrome[api] ? chrome[api]
- : window[api] ? window[api]
- : browser && browser.extension && browser.extension[api]
- ? browser.extension[api] : null
+
+ _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) {}
+
})
}