aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-07-26 08:33:22 +0800
committerDan Finlay <dan@danfinlay.com>2016-07-26 08:33:22 +0800
commitbe74589f49bbe977f881b17a0383cafa4336d9b4 (patch)
tree304192beee2c6a53827ca3593515c896f34f9941 /app
parentd484cb8f511a044c97a9a3bee3d4d415eb5988e7 (diff)
downloadtangerine-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.js2
-rw-r--r--app/scripts/lib/extension-instance.js5
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
})
}