Skip to content

Commit cb52da2

Browse files
authored
chore: Avoid obscuring the entire page content while optimizing the execution process of DevTools (#276)
1 parent ea4ee5f commit cb52da2

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

‎packages/visualizer/src/extension/popup.tsx‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,8 @@ function PlaygroundPopup() {
7373
<div className="popup-header">
7474
<Logo withGithubStar={true} />
7575
<p>
76-
Automate browser actions, extract data, and perform assertions using
77-
AI, including a Chrome extension, JavaScript SDK, and support for
78-
scripting in YAML.{' '}
76+
AI-Driven Browser Automation with Chrome Extensions, JavaScript, and
77+
YAML Scripts.{' '}
7978
<a href="https://midscenejs.com/" target="_blank" rel="noreferrer">
8079
Learn more
8180
</a>

‎packages/web-integration/src/chrome-extension/page.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default class ChromeExtensionProxyPage implements AbstractPage {
6565
await chrome.debugger.attach({ tabId: currentTabId }, '1.3');
6666
this.debuggerAttached = true;
6767
// Prevent AI logic from being influenced by changes in page width and height due to the debugger banner appearing on attach.
68-
await sleep(100);
68+
await sleep(340);
6969
// listen to the debugger detach event
7070
chrome.debugger.onEvent.addListener((source, method, params) => {
7171
console.log('debugger event', source, method, params);

‎packages/web-integration/src/extractor/web-extractor.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ function collectElementInfo(
6060
) {
6161
return null;
6262
}
63+
// Skip elements that cover the entire viewport, as they are likely background containers
64+
// rather than meaningful interactive elements
65+
if (rect.height >= window.innerHeight && rect.width >= window.innerWidth) {
66+
return null;
67+
}
68+
6369
if (isFormElement(node)) {
6470
const attributes = getNodeAttributes(node);
6571
let valueContent =

0 commit comments

Comments
 (0)