fix(browser): change default wait_until from load to domcontentloaded#68
Open
fix(browser): change default wait_until from load to domcontentloaded#68
Conversation
Updated the default wait_until parameter from 'load' to 'domcontentloaded' for browser navigation functions to improve performance and reduce waiting time for full page loads when not necessary. This change affects browser_navigate_back and browser_go_forward functions in the BrowserToolSet class to use 'domcontentloaded' as the default waiting strategy instead of 'load'. 将默认的 wait_until 参数从 'load' 更改为 'domcontentloaded' 更新了浏览器导航函数的默认 wait_until 参数,从 'load' 改为 'domcontentloaded' 以提高性能并减少不必要的完整页面加载等待时间。 此更改影响 BrowserToolSet 类中的 browser_navigate_back 和 browser_go_forward 函数,使用 'domcontentloaded' 作为默认等待策略 而不是 'load'。 fix #66 Change-Id: Ib5d4120869bfea9ea8a411b16958bf9359572b9f Signed-off-by: OhYee <oyohyee@oyohyee.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request updates BrowserToolSet’s browser history navigation defaults to wait for domcontentloaded instead of load, reducing unnecessary wait time on back/forward navigations.
Changes:
- Change
browser_navigate_backdefaultwait_untilfrom"load"to"domcontentloaded". - Change
browser_go_forwarddefaultwait_untilfrom"load"to"domcontentloaded". - Minor formatting adjustments in
_get_playwrightlogging/conditionals.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+979
to
980
| wait_until: str = "domcontentloaded", | ||
| timeout: Optional[float] = None, |
There was a problem hiding this comment.
Comment on lines
1004
to
1006
| self, | ||
| wait_until: str = "load", | ||
| wait_until: str = "domcontentloaded", | ||
| timeout: Optional[float] = None, |
There was a problem hiding this comment.
This PR changes behavior by altering the default wait_until for browser_navigate_back/browser_go_forward, but there are no unit tests asserting the new defaults. Consider adding a small test (e.g., via inspect.signature) to lock in the new default and prevent accidental regressions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updated the default wait_until parameter from 'load' to 'domcontentloaded' for browser navigation functions to improve performance and reduce waiting time for full page loads when not necessary.
This change affects browser_navigate_back and browser_go_forward functions in the BrowserToolSet class to use 'domcontentloaded' as the default waiting strategy instead of 'load'.
将默认的 wait_until 参数从 'load' 更改为 'domcontentloaded'
更新了浏览器导航函数的默认 wait_until 参数,从 'load' 改为 'domcontentloaded' 以提高性能并减少不必要的完整页面加载等待时间。
此更改影响 BrowserToolSet 类中的 browser_navigate_back 和
browser_go_forward 函数,使用 'domcontentloaded' 作为默认等待策略 而不是 'load'。
fix #66
Change-Id: Ib5d4120869bfea9ea8a411b16958bf9359572b9f
Fix bugs
Bug detail
Pull request tasks
Update docs
Reason for update
Pull request tasks
Add contributor
Contributed content
Content detail
Others
Reason for update