tolgee-js icon indicating copy to clipboard operation
tolgee-js copied to clipboard

[Feature request] Automated screenshot without browser extension

Open KaKi87 opened this issue 4 years ago • 5 comments

For compatibility with Tauri & Electron apps.

Thanks

KaKi87 avatar Mar 30 '22 19:03 KaKi87

Interesting Idea! Will look to implementation option of such feature. But it would probably be doable!

JanCizmar avatar Mar 31 '22 06:03 JanCizmar

We might use https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia?ref=hackernoon.com instead. But I'm not sure how it works in Tauri and Electron ...

stepan662 avatar Apr 19 '22 14:04 stepan662

It should work fine.

KaKi87 avatar Apr 19 '22 14:04 KaKi87

Ok, I've tried the getDisplayMedia API, but I didn't find it very practical, because it asks you for permission every time and you also have to select which tab, so I'm not in favor in implementing this. If you know any other practical method let me know.

stepan662 avatar May 23 '23 15:05 stepan662

it asks you for permission every time

Did you disable cache or something ? Permissions are normally remembered once granted.

you also have to select which tab

I don't think this can be bypassed though.

If you know any other practical method let me know.

There's no clean alternative.

A dirty one would be to manually generate an image by parsing HTML & CSS : https://www.npmjs.com/package/html2canvas

A just-a-little-bit less dirty one would be to load said HTML & CSS into a server-side headless browser and generate a screenshot.

KaKi87 avatar May 23 '23 15:05 KaKi87

Hello, Was this implemented ? Thanks

KaKi87 avatar Apr 22 '24 15:04 KaKi87

Hey, no, I didn't find the solution very pratical, so I've decided to skip this.

stepan662 avatar Apr 23 '24 07:04 stepan662

I guess, we would need to support this for each platform separately. For Electron, there is Desktop Capturer API.

However, this is probably out of scope for now.

JanCizmar avatar Apr 23 '24 07:04 JanCizmar