mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fix integration tests
This commit is contained in:
parent
be74589f49
commit
b43b9f13e9
@ -26,10 +26,25 @@ function Extension () {
|
|||||||
const _this = this
|
const _this = this
|
||||||
|
|
||||||
apis.forEach(function (api) {
|
apis.forEach(function (api) {
|
||||||
_this[api] = chrome !== undefined && chrome[api] ? chrome[api]
|
|
||||||
: window[api] ? window[api]
|
_this[api] = null
|
||||||
: browser && browser.extension && browser.extension[api]
|
|
||||||
? browser.extension[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) {}
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user