-
Notifications
You must be signed in to change notification settings - Fork 1
fix(browser): change default wait_until from load to domcontentloaded #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5cc9ce1
1856f4e
1c6e080
7dd8597
9bdfdce
d56eb1f
7f603bb
32bb0ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -751,20 +751,26 @@ def _get_playwright(self, sb: BrowserSandbox) -> "BrowserPlaywrightSync": | |
| Automatically recreates the connection when the thread that created it has exited, | ||
| because Playwright's internal greenlet is bound to the thread that created it. | ||
| """ | ||
| if self._playwright_sync is not None and self._playwright_thread is not None: | ||
| if ( | ||
| self._playwright_sync is not None | ||
| and self._playwright_thread is not None | ||
| ): | ||
| current_thread = threading.current_thread() | ||
| creator_thread = self._playwright_thread | ||
| if not creator_thread.is_alive() or current_thread is not creator_thread: | ||
| if ( | ||
| not creator_thread.is_alive() | ||
| or current_thread is not creator_thread | ||
| ): | ||
| if not creator_thread.is_alive(): | ||
| logger.debug( | ||
| "Playwright creating thread (id=%s) has exited, recreating" | ||
| " connection", | ||
| "Playwright creating thread (id=%s) has exited," | ||
| " recreating connection", | ||
| creator_thread.ident, | ||
| ) | ||
| else: | ||
| logger.debug( | ||
| "Playwright creating thread (id=%s) differs from current" | ||
| " thread (id=%s), recreating connection", | ||
| "Playwright creating thread (id=%s) differs from" | ||
| " current thread (id=%s), recreating connection", | ||
| creator_thread.ident, | ||
| current_thread.ident, | ||
| ) | ||
|
|
@@ -970,7 +976,7 @@ def goto(self, url: str) -> Dict[str, Any]: | |
| ) | ||
| def browser_navigate_back( | ||
| self, | ||
| wait_until: str = "load", | ||
| wait_until: str = "domcontentloaded", | ||
| timeout: Optional[float] = None, | ||
| ) -> Dict[str, Any]: | ||
| """返回上一页 / Go back to previous page""" | ||
|
|
@@ -996,7 +1002,7 @@ def inner(sb: Sandbox): | |
| ) | ||
| def browser_go_forward( | ||
| self, | ||
| wait_until: str = "load", | ||
| wait_until: str = "domcontentloaded", | ||
| timeout: Optional[float] = None, | ||
|
Comment on lines
1004
to
1006
|
||
| ) -> Dict[str, Any]: | ||
| """前进到下一页 / Go forward to next page""" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR description references fixing issue #66, but the code change here only updates the default
wait_untilvalue for back/forward navigation. Please either update the PR description/issue reference to match the actual change, or include the missing code changes intended to address #66.