diff --git a/lib/gui/app/components/safe-webview.js b/lib/gui/app/components/safe-webview.js index 9b457190..534a422e 100644 --- a/lib/gui/app/components/safe-webview.js +++ b/lib/gui/app/components/safe-webview.js @@ -190,12 +190,17 @@ class SafeWebview extends react.PureComponent { * @param {Event} event - Event object */ didGetResponseDetails (event) { - const HTTP_OK = 200 - const HTTP_ERR = 400 + // This seems to pick up all requests related to the webview, + // only care about this event if it's a request for the main frame + if (event.resourceType === 'mainFrame') { + const HTTP_OK = 200 - this.setState({ - shouldShow: event.httpResponseCode >= HTTP_OK && event.httpResponseCode < HTTP_ERR - }) + analytics.logEvent(event) + + this.setState({ + shouldShow: event.httpResponseCode === HTTP_OK + }) + } } /**