From f800211fb5d0755f6d1800fd4b830e78b050c0d7 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Sun, 13 Oct 2019 17:35:03 +0200 Subject: browser: Work around missing responseReceived events Looks like Chrome extensively reuses request ids now. Sucks, since we relied on their uniqueness. For now ignore requests without a dedicated responseReceived event. See issue #24. --- crocoite/browser.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crocoite') diff --git a/crocoite/browser.py b/crocoite/browser.py index dc67c51..3518789 100644 --- a/crocoite/browser.py +++ b/crocoite/browser.py @@ -443,6 +443,13 @@ class SiteLoader: if item is None: # we never recorded this request (blacklisted scheme, for example) return + if not item.response: + # chrome failed to send us a responseReceived event for this item, + # so we can’t record it (missing request/response headers) + self.logger.error ('response missing', + uuid='fac3ab96-3f9b-4c5a-95c7-f83b675cdcb9', requestId=item.id) + return + req = item.request if item.url.scheme in self.allowedSchemes: item.fromLoadingFinished (kwargs) -- cgit v1.2.3