nifty-wallet/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-05 17:13:58 -07:00
try {
2017-10-10 08:36:15 -07:00
extension.runtime.getPlatformInfo((platform) => {
cb(null, platform)
})
2017-10-05 17:13:58 -07:00
} catch (e) {
2017-10-10 08:36:15 -07:00
cb(e)
2017-10-05 17:13:58 -07:00
}
2017-10-04 09:56:18 -07:00
}
}
module.exports = ExtensionPlatform