-
Notifications
You must be signed in to change notification settings - Fork 108
feat(tools): add use_browser tool to Strands tools repository #102
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
Merged
Conversation
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
Adding functionality so use_browser tool has some retry functionality and supports multiple tabs and switching between them.
…errors for better error handling
…actions are only called with their required arguments
…owser actions as methods
mehtarac
reviewed
Jun 27, 2025
mehtarac
reviewed
Jun 27, 2025
When I tried to use the tool I hit this error:
I think use_browser tool should handle this error gradually and install required dependencies ^^ |
mehtarac
approved these changes
Jun 30, 2025
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.
LGTM
cagataycali
pushed a commit
to cagataycali/tools
that referenced
this pull request
Jul 2, 2025
…s-agents#102) * feat(tools): add use_browser tool to Strands tools repository * test(use_browser): add more unit testing for use_browser tool * feat(tools): add retry and multi-tab support to use_browser tool Adding functionality so use_browser tool has some retry functionality and supports multiple tabs and switching between them. * feat: add more retry logic and environment variables * fix(use_browser): fix screenshot error and using Playwright specific errors for better error handling * fix(use_browser): fix logs and fix how actions are being called, now actions are only called with their required arguments * fix(use_browser): fix merge conflicts in README file * Delete src/strands_tools/use_computer.py * test(use_browser): add more unit testing for use_browser tool * Update use_browser.py * test(use_browser): add more unit testing for use_browser tool * fix(use_browser): fix merge conflicts in README file * feat(use_browser): Added BrowserApiMethods class which has all the browser actions as methods * feat: Updating readme and pyproject.toml * feat: Adding use_browser tool * fix: fixing README file * fix: fixing dependencies for testing * fix: cleaning logs and updating README file * fix: fixing log statements to pass all checks
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.
Description
Adding a use_browser tool, that gives an agent actions, so they interact with browsers (just chromium right now). This tool relies on Playwright to perform automated actions on a browser. Playwright allows for a browser to be launched with different launch options. One of these launch options is persistent_context, which allows users to launch a browser and load in the saved data from whatever the specified user_data_dir is. This feature is used to save cookie settings, local storage, sessions storage, browser history, saved passwords, etc. Right now you can ask an agent to use the use_browser tool to launch a browser with persistent_context set to true and specify a file path for user_data_dir. Then, any usernames, bookmarks you create, or search history should be stored in the user_data_dir and then the browser can be relaunched at a later date.
Related Issues
https://github.com/strands-agents/private-sdk-python-staging/issues/72
This PR addressed the concerns with the original PR for this tool: #88
Documentation PR
Added some documentation on how to use this tool in the README
Type of Change
Testing
[How have you tested the change?]
hatch fmt --linter
hatch fmt --formatter
hatch test --all
Checklist
I have read the CONTRIBUTING document
I have added tests that prove my fix is effective or my feature works
I have updated the documentation accordingly
I have added an appropriate example to the documentation to outline the feature
My changes generate no new warnings
Any dependent changes have been merged and published
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.