Skip to content

Commit

Permalink
Merge pull request #305 from galgeek/chrome130fixes
Browse files Browse the repository at this point in the history
small fixes for chrome v.130
  • Loading branch information
adam-miller authored Dec 4, 2024
2 parents d9d0999 + c781f53 commit 210491c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions brozzler/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion brozzler/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 210491c

Please sign in to comment.