diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-07-26 08:33:22 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-07-26 08:33:22 +0800 |
commit | be74589f49bbe977f881b17a0383cafa4336d9b4 (patch) | |
tree | 304192beee2c6a53827ca3593515c896f34f9941 /app | |
parent | d484cb8f511a044c97a9a3bee3d4d415eb5988e7 (diff) | |
download | tangerine-wallet-browser-be74589f49bbe977f881b17a0383cafa4336d9b4.tar tangerine-wallet-browser-be74589f49bbe977f881b17a0383cafa4336d9b4.tar.gz tangerine-wallet-browser-be74589f49bbe977f881b17a0383cafa4336d9b4.tar.bz2 tangerine-wallet-browser-be74589f49bbe977f881b17a0383cafa4336d9b4.tar.lz tangerine-wallet-browser-be74589f49bbe977f881b17a0383cafa4336d9b4.tar.xz tangerine-wallet-browser-be74589f49bbe977f881b17a0383cafa4336d9b4.tar.zst tangerine-wallet-browser-be74589f49bbe977f881b17a0383cafa4336d9b4.zip |
Fix extension tests
Diffstat (limited to 'app')
-rw-r--r-- | app/scripts/contentscript.js | 2 | ||||
-rw-r--r-- | app/scripts/lib/extension-instance.js | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js index 103ea5348..1eb04059d 100644 --- a/app/scripts/contentscript.js +++ b/app/scripts/contentscript.js @@ -5,7 +5,7 @@ const extension = require('./lib/extension') const fs = require('fs') const path = require('path') -const inpageText = fs.readFileSync(__dirname + '/inpage.js').toString() +const inpageText = fs.readFileSync(path.join(__dirname + '/inpage.js')).toString() // Eventually this streaming injection could be replaced with: // https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Language_Bindings/Components.utils.exportFunction diff --git a/app/scripts/lib/extension-instance.js b/app/scripts/lib/extension-instance.js index e0e7c948b..b9d0ed06d 100644 --- a/app/scripts/lib/extension-instance.js +++ b/app/scripts/lib/extension-instance.js @@ -26,7 +26,10 @@ function Extension () { const _this = this apis.forEach(function (api) { - _this[api] = chrome ? chrome[api] : window[api] || browser.extension[api] + _this[api] = chrome !== undefined && chrome[api] ? chrome[api] + : window[api] ? window[api] + : browser && browser.extension && browser.extension[api] + ? browser.extension[api] : null }) } |