1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

platforms: put context for extension in platform extension class

This commit is contained in:
frankiebee 2017-09-21 11:12:04 -07:00
parent 418f01411e
commit 14b9d16ece
3 changed files with 4 additions and 2 deletions

View File

@ -20,7 +20,6 @@ window.log = log
log.setDefaultLevel(METAMASK_DEBUG ? 'debug' : 'warn') log.setDefaultLevel(METAMASK_DEBUG ? 'debug' : 'warn')
const platform = new ExtensionPlatform() const platform = new ExtensionPlatform()
platform.context = 'extension'
const notificationManager = new NotificationManager() const notificationManager = new NotificationManager()
global.METAMASK_NOTIFIER = notificationManager global.METAMASK_NOTIFIER = notificationManager

View File

@ -196,7 +196,7 @@ module.exports = class MetamaskController extends EventEmitter {
}, },
// rpc data source // rpc data source
rpcUrl: this.networkController.getCurrentRpcAddress(), rpcUrl: this.networkController.getCurrentRpcAddress(),
originHttpHeaderKey: this.platform.context === 'extension' ? 'X-Metamask-Origin' : undefined, originHttpHeaderKey: this.platform.isExtension ? 'X-Metamask-Origin' : undefined,
// account mgmt // account mgmt
getAccounts: (cb) => { getAccounts: (cb) => {
const isUnlocked = this.keyringController.memStore.getState().isUnlocked const isUnlocked = this.keyringController.memStore.getState().isUnlocked

View File

@ -5,6 +5,9 @@ class ExtensionPlatform {
// //
// Public // Public
// //
get isExtension () {
return true
}
reload () { reload () {
extension.runtime.reload() extension.runtime.reload()