GeezerVison is showing github.com — chore: roll to Playwright 1.16.0-next-1633339886000 (#932) · Coder-Soder/playwright-python@287d820
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: README.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4,7 +4,7 @@ Playwright is a Python library to automate [Chromium](https://www.chromium.org/H | 4 | 4 |
| 5 | 5 | | | Linux | macOS | Windows | | 6 | 6 | | :--- | :---: | :---: | :---: | | 7 | | -| Chromium <!-- GEN:chromium-version -->96.0.4655.0<!-- GEN:stop --> | ✅ | ✅ | ✅ | | | 7 | +| Chromium <!-- GEN:chromium-version -->96.0.4659.0<!-- GEN:stop --> | ✅ | ✅ | ✅ | | 8 | 8 | | WebKit <!-- GEN:webkit-version -->15.0<!-- GEN:stop --> | ✅ | ✅ | ✅ | | 9 | 9 | | Firefox <!-- GEN:firefox-version -->92.0<!-- GEN:stop --> | ✅ | ✅ | ✅ | | 10 | 10 |
| |
Collapse file Copy file name to clipboardExpand all lines: playwright/_impl/_browser_context.py +9-2Lines changed: 9 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -149,13 +149,20 @@ def _on_page(self, page: Page) -> None: | 149 | 149 | page._opener.emit(Page.Events.Popup, page) | 150 | 150 |
| 151 | 151 | def _on_route(self, route: Route, request: Request) -> None: | | 152 | + handled = False | 152 | 153 | for handler_entry in self._routes: | 153 | 154 | if handler_entry.matches(request.url): | 154 | 155 | result = handler_entry.handle(route, request) | 155 | 156 | if inspect.iscoroutine(result): | 156 | 157 | asyncio.create_task(result) | 157 | | - return | 158 | | - asyncio.create_task(route.continue_()) | | 158 | + handled = True | | 159 | + break | | 160 | + if not handled: | | 161 | + asyncio.create_task(route.continue_()) | | 162 | + else: | | 163 | + self._routes = list( | | 164 | + filter(lambda route: route.expired() is False, self._routes) | | 165 | + ) | 159 | 166 |
| 160 | 167 | def _on_binding(self, binding_call: BindingCall) -> None: | 161 | 168 | func = self._bindings.get(binding_call._initializer["name"]) | |
Collapse file Copy file name to clipboardExpand all lines: playwright/_impl/_helper.py +5-3Lines changed: 5 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -213,13 +213,15 @@ def __init__( | 213 | 213 | self._times = times | 214 | 214 | self._handled_count = 0 | 215 | 215 |
| | 216 | + def expired(self) -> bool: | | 217 | + return self._times is not None and self._handled_count >= self._times | | 218 | + | 216 | 219 | def matches(self, request_url: str) -> bool: | 217 | | - if self._times and self._handled_count >= self._times: | 218 | | - return False | 219 | 220 | return self.matcher.matches(request_url) | 220 | 221 |
| 221 | 222 | def handle(self, route: "Route", request: "Request") -> Union[Coroutine, Any]: | 222 | | - self._handled_count += 1 | | 223 | + if self._times: | | 224 | + self._handled_count += 1 | 223 | 225 | return cast( | 224 | 226 | Callable[["Route", "Request"], Union[Coroutine, Any]], self.handler | 225 | 227 | )(route, request) | |
Collapse file Copy file name to clipboardExpand all lines: playwright/_impl/_page.py +9-2Lines changed: 9 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -212,13 +212,20 @@ def _on_frame_detached(self, frame: Frame) -> None: | 212 | 212 | self.emit(Page.Events.FrameDetached, frame) | 213 | 213 |
| 214 | 214 | def _on_route(self, route: Route, request: Request) -> None: | | 215 | + handled = False | 215 | 216 | for handler_entry in self._routes: | 216 | 217 | if handler_entry.matches(request.url): | 217 | 218 | result = handler_entry.handle(route, request) | 218 | 219 | if inspect.iscoroutine(result): | 219 | 220 | asyncio.create_task(result) | 220 | | - return | 221 | | - self._browser_context._on_route(route, request) | | 221 | + handled = True | | 222 | + break | | 223 | + if not handled: | | 224 | + self._browser_context._on_route(route, request) | | 225 | + else: | | 226 | + self._routes = list( | | 227 | + filter(lambda route: route.expired() is False, self._routes) | | 228 | + ) | 222 | 229 |
| 223 | 230 | def _on_binding(self, binding_call: "BindingCall") -> None: | 224 | 231 | func = self._bindings.get(binding_call._initializer["name"]) | |
Collapse file Copy file name to clipboardExpand all lines: setup.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 28 | 28 | InWheel = None | 29 | 29 | from wheel.bdist_wheel import bdist_wheel as BDistWheelCommand | 30 | 30 |
| 31 | | -driver_version = "1.16.0-next-1632960932000" | | 31 | +driver_version = "1.16.0-next-1633339886000" | 32 | 32 |
| 33 | 33 |
| 34 | 34 | def extractall(zip: zipfile.ZipFile, path: str) -> None: | |
|