Merge pull request #2931 from balena-io/roman/debugging

Catch console log messages from SafeWebView
This commit is contained in:
Alexis Svinartchouk 2019-10-14 15:34:13 +02:00 committed by GitHub
commit 506f9bf0e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,9 +107,14 @@ class SafeWebview extends react.PureComponent {
this.didFailLoad = _.bind(this.didFailLoad, this)
this.didGetResponseDetails = _.bind(this.didGetResponseDetails, this)
const logWebViewMessage = (event) => {
console.log('Message from SafeWebview:', event.message);
};
this.eventTuples = [
[ 'did-fail-load', this.didFailLoad ],
[ 'new-window', this.constructor.newWindow ]
[ 'new-window', this.constructor.newWindow ],
[ 'console-message', logWebViewMessage ]
]
// Make a persistent electron session for the webview