Skip to content

Commit

Permalink
Update: fix cursor animation initilization after page navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
m2rads committed Nov 14, 2024
1 parent 219c452 commit 09ff240
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions packages/shortest/src/browser-use/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,19 @@ export class BrowserTool extends BaseBrowserTool {
}

private async showClickAnimation(): Promise<void> {
await this.page.evaluate(() => {
(window as any).showClick();
});
try {
await this.page.evaluate(() => {
const cursor = document.getElementById('ai-cursor');
if (cursor) {
cursor.style.transform = 'translate(-50%, -50%) scale(0.8)';
setTimeout(() => {
cursor.style.transform = 'translate(-50%, -50%) scale(1)';
}, 100);
}
});
} catch (error) {
// fail silently
}
}

async execute(input: ActionInput): Promise<ToolResult> {
Expand Down

0 comments on commit 09ff240

Please sign in to comment.