diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-07-26 08:47:14 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-07-26 08:47:14 +0800 |
commit | b43b9f13e97258d6d546e62a2fd280b44045a610 (patch) | |
tree | 65ed2ac79ee1861f41aa177a75a25d71145cee66 /app/scripts/lib | |
parent | be74589f49bbe977f881b17a0383cafa4336d9b4 (diff) | |
download | tangerine-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.js | 23 |
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) {} + }) } |