Skip to content

Commit

Permalink
fix: browser_context.route for service worker requests (#2345)
Browse files Browse the repository at this point in the history
  • Loading branch information
LironHaroni authored Mar 7, 2024
1 parent 8d3a5eb commit dd85f0d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion playwright/_impl/_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,10 @@ def _target_closed_future(self) -> asyncio.Future:
return page._closed_or_crashed_future

def _safe_page(self) -> "Optional[Page]":
return cast("Frame", from_channel(self._initializer["frame"]))._page
frame = from_nullable_channel(self._initializer.get("frame"))
if not frame:
return None
return cast("Frame", frame)._page


class Route(ChannelOwner):
Expand Down

0 comments on commit dd85f0d

Please sign in to comment.