diff options
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | app/scripts/platforms/extension.js | 9 | ||||
-rw-r--r-- | ui/app/config.js | 8 | ||||
-rw-r--r-- | ui/app/reducers.js | 29 |
4 files changed, 36 insertions, 11 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 573627917..0529d3318 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ - Add support for new eth_signTypedData method per EIP 712. - Fix bug where some transactions would be shown as pending forever, even after successfully mined. - Fix bug where a transaction might be shown as pending forever if another tx with the same nonce was mined. +- Add OS and browser version information to state log dump (for debugging purposes only). - Fix link to support article on token addresses. ## 3.10.9 2017-10-5 diff --git a/app/scripts/platforms/extension.js b/app/scripts/platforms/extension.js index 0afe04b74..2f47512eb 100644 --- a/app/scripts/platforms/extension.js +++ b/app/scripts/platforms/extension.js @@ -17,6 +17,15 @@ class ExtensionPlatform { return extension.runtime.getManifest().version } + getPlatformInfo (cb) { + try { + extension.runtime.getPlatformInfo((platform) => { + cb(null, platform) + }) + } catch (e) { + cb(e) + } + } } module.exports = ExtensionPlatform diff --git a/ui/app/config.js b/ui/app/config.js index 0fe232c07..c14fa1d28 100644 --- a/ui/app/config.js +++ b/ui/app/config.js @@ -113,7 +113,13 @@ ConfigScreen.prototype.render = function () { alignSelf: 'center', }, 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'), ]), diff --git a/ui/app/reducers.js b/ui/app/reducers.js index e1a890535..3d0a58f81 100644 --- a/ui/app/reducers.js +++ b/ui/app/reducers.js @@ -41,17 +41,26 @@ function rootReducer (state, action) { return state } +window.logStateString = function (cb) { + let state = window.METAMASK_CACHED_LOG_STATE + const version = global.platform.getVersion() + const browser = window.navigator.userAgent + return global.platform.getPlatformInfo((err, platform) => { + if (err) { + return cb(err) + } + state.version = version + state.platform = platform + state.browser = browser + let stateString = JSON.stringify(state, removeSeedWords, 2) + return cb(null, stateString) + }) +} + window.logState = function () { - const state = window.METAMASK_CACHED_LOG_STATE - let version - try { - version = global.platform.getVersion() - } catch (e) { - version = 'unable to load version.' - } - state.version = version - const stateString = JSON.stringify(state, removeSeedWords, 2) - return stateString + return window.logStateString((result) => { + console.log(result) + }) } function removeSeedWords (key, value) { |