AutomaApp / automa

A browser extension for automating your browser by connecting blocks
https://www.automa.site
Other
10.73k stars 1.09k forks source link

fix: ensure correct active tab detection from the extension dashboard #1708

Closed zthxxx closed 1 month ago

zthxxx commented 2 months ago

fix: ensure correct active tab detection from the extension dashboard

When trying to detect the "active tab" from the Automa extension's dashboard (like when triggering a CSS selector), the dashboard window is always focused. This caused the original code to fail in correctly identifying the active tab and throw error.

Now, using the windows.getLastFocused() API to query "normal" type window, we can accurately fetch the active tab without extension's panel window.

That's fix both of "Element Selector" and "Record Workflow" / "Record from here" functions.

Issue example screenshot:

image
zthxxx commented 2 months ago

@Kholid060 hope you find this fix helpful~