mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-30 16:18:07 +01:00
Merge pull request #2275 from MetaMask/version-debugging
Add OS Version and Browser Version to State Logs
This commit is contained in:
commit
4ac198eebc
@ -7,6 +7,7 @@
|
|||||||
- Add support for alternative ENS TLDs (Ethereum Name Service Top-Level Domains).
|
- Add support for alternative ENS TLDs (Ethereum Name Service Top-Level Domains).
|
||||||
- Lower minimum gas price to 0.1 GWEI.
|
- Lower minimum gas price to 0.1 GWEI.
|
||||||
- Remove web3 injection message from production (thanks to @ChainsawBaby)
|
- Remove web3 injection message from production (thanks to @ChainsawBaby)
|
||||||
|
- Add additional debugging info to our state logs, specifically OS version and browser version.
|
||||||
|
|
||||||
## 3.11.2 2017-10-21
|
## 3.11.2 2017-10-21
|
||||||
|
|
||||||
|
@ -17,6 +17,15 @@ class ExtensionPlatform {
|
|||||||
return extension.runtime.getManifest().version
|
return extension.runtime.getManifest().version
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getPlatformInfo (cb) {
|
||||||
|
try {
|
||||||
|
extension.runtime.getPlatformInfo((platform) => {
|
||||||
|
cb(null, platform)
|
||||||
|
})
|
||||||
|
} catch (e) {
|
||||||
|
cb(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = ExtensionPlatform
|
module.exports = ExtensionPlatform
|
||||||
|
@ -113,7 +113,13 @@ ConfigScreen.prototype.render = function () {
|
|||||||
alignSelf: 'center',
|
alignSelf: 'center',
|
||||||
},
|
},
|
||||||
onClick (event) {
|
onClick (event) {
|
||||||
exportAsFile('MetaMask State Logs', window.logState())
|
window.logStateString((err, result) => {
|
||||||
|
if (err) {
|
||||||
|
state.dispatch(actions.displayWarning('Error in retrieving state logs.'))
|
||||||
|
} else {
|
||||||
|
exportAsFile('MetaMask State Logs', result)
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
}, 'Download State Logs'),
|
}, 'Download State Logs'),
|
||||||
]),
|
]),
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
const extend = require('xtend')
|
const extend = require('xtend')
|
||||||
|
const copyToClipboard = require('copy-to-clipboard')
|
||||||
|
|
||||||
//
|
//
|
||||||
// Sub-Reducers take in the complete state and return their sub-state
|
// Sub-Reducers take in the complete state and return their sub-state
|
||||||
@ -41,17 +42,33 @@ function rootReducer (state, action) {
|
|||||||
return state
|
return state
|
||||||
}
|
}
|
||||||
|
|
||||||
window.logState = function () {
|
window.logStateString = function (cb) {
|
||||||
const state = window.METAMASK_CACHED_LOG_STATE
|
let state = window.METAMASK_CACHED_LOG_STATE
|
||||||
let version
|
const version = global.platform.getVersion()
|
||||||
try {
|
const browser = window.navigator.userAgent
|
||||||
version = global.platform.getVersion()
|
return global.platform.getPlatformInfo((err, platform) => {
|
||||||
} catch (e) {
|
if (err) {
|
||||||
version = 'unable to load version.'
|
return cb(err)
|
||||||
}
|
}
|
||||||
state.version = version
|
state.version = version
|
||||||
const stateString = JSON.stringify(state, removeSeedWords, 2)
|
state.platform = platform
|
||||||
return stateString
|
state.browser = browser
|
||||||
|
let stateString = JSON.stringify(state, removeSeedWords, 2)
|
||||||
|
return cb(null, stateString)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
window.logState = function (toClipboard) {
|
||||||
|
return window.logStateString((err, result) => {
|
||||||
|
if (err) {
|
||||||
|
console.error(err.message)
|
||||||
|
} else if (toClipboard) {
|
||||||
|
copyToClipboard(result)
|
||||||
|
console.log('State log copied')
|
||||||
|
} else {
|
||||||
|
console.log(result)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeSeedWords (key, value) {
|
function removeSeedWords (key, value) {
|
||||||
|
Loading…
Reference in New Issue
Block a user