diff --git a/brozzler/browser.py b/brozzler/browser.py index 9c725890..4b602f1d 100644 --- a/brozzler/browser.py +++ b/brozzler/browser.py @@ -658,11 +658,9 @@ def configure_browser( ): headers = extra_headers or {} headers["Accept-Encoding"] = "gzip" # avoid encodings br, sdch - self.websock_thread.expect_result(self._command_id.peek()) msg_id = self.send_to_chrome( method="Network.setExtraHTTPHeaders", params={"headers": headers} ) - self._wait_for(lambda: self.websock_thread.received_result(msg_id), timeout=10) if user_agent: msg_id = self.send_to_chrome( method="Network.setUserAgentOverride", params={"userAgent": user_agent} diff --git a/brozzler/worker.py b/brozzler/worker.py index 116bb75b..3f9d15ab 100644 --- a/brozzler/worker.py +++ b/brozzler/worker.py @@ -414,7 +414,7 @@ def _on_service_worker_version_updated(chrome_msg): self.logger.trace("%r", chrome_msg) if chrome_msg.get("params", {}).get("versions"): url = chrome_msg.get("params", {}).get("versions")[0].get("scriptURL") - if url and url not in sw_fetched: + if url and url.startswith("http") and url not in sw_fetched: self.logger.info("fetching service worker script %s", url) self._fetch_url(site, url=url) sw_fetched.add(url)