This change ensures that sensitive data in action results is filtered before being included in state messages sent to the LLM. This prevents accidental leakage of private information. New tests are added to verify this functionality.
Co-authored-by: mailmertunsal <mailmertunsal@gmail.com>
- Updated the method of obtaining CDP sessions to utilize the public API, enhancing error handling during session retrieval.
- Added exception handling to ensure graceful failure when sessions cannot be created or retrieved, improving robustness in both the main functionality and tests.
- Eliminated the caching of target types in SessionManager, simplifying the management of target information.
- Updated various components to directly access target types from the Target objects, enhancing clarity and reducing redundancy.
- Adjusted related methods in BrowserSession, CrashWatchdog, and DomService to reflect the changes in target type retrieval.
- Introduced a new test to verify the ability to click elements inside true cross-origin iframes, specifically targeting external domains like example.com.
- Implemented a fixture to create a browser session with cross-origin iframe support, enhancing the test's reliability and clarity.
- The test checks for the presence of elements from different CDP targets and ensures that at least one element from the cross-origin iframe can be successfully clicked.
This addition aims to improve the coverage of cross-origin iframe interactions in the browser automation framework, ensuring robust functionality in real-world scenarios.
- Updated the DOMTreeSerializer to remove debug code related to cross-origin iframe detection, enhancing clarity and maintainability.
- Adjusted test cases to replace the cross-origin iframe source with a placeholder (about:blank) for improved test isolation and reliability.
- Updated comments and descriptions in tests to reflect the changes in iframe handling, ensuring accurate documentation of test behavior.
This change aims to streamline the handling of cross-origin iframes in both the serializer and tests, improving overall robustness and maintainability.
- Updated test to verify clicking elements inside iframes in different CDP targets, enhancing the description for better understanding.
- Replaced the previous cross-origin iframe setup with a more controlled iframe content for testing.
- Adjusted assertions to ensure at least one element from the iframe is found, improving test reliability.
- Cleaned up comments and print statements for clarity, ensuring the test accurately reflects its purpose.
This change aims to enhance the robustness and maintainability of tests involving iframe interactions in the browser automation framework.
- Updated the sleep duration from 3 to 5 seconds to accommodate potential network delays in CI environments.
- Enhanced the comment to clarify that cross-origin iframe extraction is enabled when getting the DOM state.
This change aims to improve the reliability of tests involving cross-origin iframes by allowing sufficient time for them to load before interaction.
Verifies that:
- Cross-origin iframe DOM extraction works (finds multiple CDP targets)
- Elements from cross-origin iframes appear in the selector_map
- Elements inside cross-origin iframes can be clicked successfully
- Target/session switching works correctly for cross-origin actions
The test uses example.com as the cross-origin iframe source and
clicks the "Learn more" link inside the iframe to verify end-to-end
functionality.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>