1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 18:41:38 +01:00
metamask-extension/app/scripts/platforms/extension.js

32 lines
487 B
JavaScript
Raw Normal View History

const extension = require('extensionizer')
class ExtensionPlatform {
//
// Public
//
reload () {
extension.runtime.reload()
}
openWindow ({ url }) {
extension.tabs.create({ url })
}
getVersion () {
return extension.runtime.getManifest().version
}
getPlatformInfo (cb) {
2017-10-06 02:13:58 +02:00
try {
2017-10-10 17:36:15 +02:00
extension.runtime.getPlatformInfo((platform) => {
cb(null, platform)
})
2017-10-06 02:13:58 +02:00
} catch (e) {
2017-10-10 17:36:15 +02:00
cb(e)
2017-10-06 02:13:58 +02:00
}
2017-10-04 18:56:18 +02:00
}
}
module.exports = ExtensionPlatform