fix(browser): change default wait_until from load to domcontentloaded#68
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>
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.
| wait_until: str = "domcontentloaded", | ||
| timeout: Optional[float] = None, |
There was a problem hiding this comment.
| 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.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
|
@copilot github action run failed at |
Co-authored-by: OhYee <13498329+OhYee@users.noreply.github.com>
…back/go_forward Co-authored-by: OhYee <13498329+OhYee@users.noreply.github.com>
test(browser): lock in domcontentloaded defaults for browser_navigate_back/go_forward
Co-authored-by: OhYee <13498329+OhYee@users.noreply.github.com>
fix(ci): resolve mypy failure and add wait_until default regression tests
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