wxt-dev / wxt

⚡ Next-gen Web Extension Framework
https://wxt.dev
MIT License
4.14k stars 168 forks source link

I did not find any relevant statements about the DesktopCapture API in the declaration file, which is part of the Google Extension API #680

Closed message163 closed 2 months ago

message163 commented 4 months ago

Describe the bug

I did not find any relevant statements about the DesktopCapture API in the declaration file, which is part of the Google Extension API

To Reproduce

browser.desktopCapture.chooseDesktopMedia(["window","screen","tab"],tab, (streamId:string) => { console.log(streamId) })

image

aklinker1 commented 4 months ago

This is a non-standard API only chrome supports, so it is not typed. I'm considering adding types for these anyways, but haven't yet because the goal of WXT is to promote cross-browser development.

message163 commented 4 months ago

If allowed, I can contribute this part of the declaration code

aklinker1 commented 4 months ago

@message163 please do! Might be hard because of the way @types/webextension-polyfill and @types/chrome use namespaces... But ideally we just add any types we need from @types/chrome into the existing AugmentedBrowser types.

https://github.com/wxt-dev/wxt/blob/main/packages%2Fwxt%2Fsrc%2Fbrowser.ts#L6-L9

aklinker1 commented 2 months ago

Just released an experiment feature in wxt@0.19 to switch to @types/chrome, which has this type in it. Try it out and let me know how it goes: https://github.com/wxt-dev/wxt/issues/868