mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-27 12:56:01 +01:00
a167bbc5a0
I'm unsure which will be more performant: A notification using a trimmed down version of the UI, or using them both, letting the browser cache them both. In any case, here I've modified the normal UI to recognize when it's a popup, and change the UX accordingly in a few ways: - Hide the menu bar - Hide the back button from the notifications view. - When confirming the last tx, close the window.
58 lines
821 B
JavaScript
58 lines
821 B
JavaScript
const apis = [
|
|
'alarms',
|
|
'bookmarks',
|
|
'browserAction',
|
|
'commands',
|
|
'contextMenus',
|
|
'cookies',
|
|
'downloads',
|
|
'events',
|
|
'extension',
|
|
'extensionTypes',
|
|
'history',
|
|
'i18n',
|
|
'idle',
|
|
'notifications',
|
|
'pageAction',
|
|
'runtime',
|
|
'storage',
|
|
'tabs',
|
|
'webNavigation',
|
|
'webRequest',
|
|
'windows',
|
|
]
|
|
|
|
function Extension () {
|
|
const _this = this
|
|
|
|
apis.forEach(function (api) {
|
|
|
|
_this[api] = null
|
|
|
|
try {
|
|
if (chrome[api]) {
|
|
_this[api] = chrome[api]
|
|
}
|
|
} catch (e) {}
|
|
|
|
try {
|
|
if (window[api]) {
|
|
_this[api] = window[api]
|
|
}
|
|
} catch (e) {}
|
|
|
|
try {
|
|
if (browser[api]) {
|
|
_this[api] = browser[api]
|
|
}
|
|
} catch (e) {}
|
|
|
|
try {
|
|
_this.api = browser.extension[api]
|
|
} catch (e) {}
|
|
|
|
})
|
|
}
|
|
|
|
module.exports = Extension
|