balta2ar / brotab

Control your browser's tabs from the command line
MIT License
389 stars 27 forks source link

Feature request: screenshot tabs #106

Open digitalsignalperson opened 10 months ago

digitalsignalperson commented 10 months ago

This is something I'm interested in to be able to screenshot all or specific tabs from cli/scripts.

perhaps it's only possible to capture the active tab? At least I found chrome.tabs.captureVisibleTab

and the base64 image could be sent back

Edit: testing this hacking a bit on background.js and is straightforward enough. Just need to figure out whether the first arg for windowId should be provided by cli, or maybe getLastFocused() and return the window and tab id for reference along with image data. Maybe write the image to f'{client_id}.{window_id}.{tab_id}.png'