Re: [mediacapture-handle] Use postMessage pattern for two-way messaging. (#69)

> (Also, your proposal does not work for [Conditional Focus](https://github.com/WICG/conditional-focus/blob/main/README.md), because the cached message you propose will only be readable after the window of opportunity closes.)

Thanks for asking about that: capturers would register `captureController.onmessage` ahead of calling `getDisplayMedia`, so the initial event would fire within the window of opportunity (on gDM's queued success task, similar to how we do it in sRD). So this should work with Conditional Focus, which is an important goal. I'm sure we can work out those details.

> > We also need to stop reinventing postMessage in https://github.com/w3c/mediacapture-handle/issues/11 and https://github.com/w3c/mediacapture-handle/issues/68.
> 
> "Need to stop" - strong wording there! But an explanation is missing for why we "need" this.

Please see https://github.com/w3c/mediacapture-handle/issues/11 and https://github.com/w3c/mediacapture-handle/issues/68 for explanations. If they're insufficient, let's discuss it there.

>  It is unclear to me why we "need" to break the Web through cosmetic changes that confer no added functionality.

[Again](https://github.com/w3c/mediacapture-handle/issues/69#issuecomment-1307983217), "Being able to pass real messages, even objects (like cropTargets), would be new functionality (solving https://github.com/w3c/mediacapture-handle/issues/11 and https://github.com/w3c/mediacapture-handle/issues/68)." so I don't think it's accurate to say "no added functionality".

> As for the viability of this mechanism as a replacement - I have [my own proposal](https://github.com/w3c/mediacapture-handle/issues/70) to **extend** Capture Handle with a MessagePort. If you check out the *Challenges* portion of that proposal, I hope you will see why I have a different proposal than yours.

I see that was opened an hour ago, so thanks I'll be happy to take a look.

-- 
GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/mediacapture-handle/issues/69#issuecomment-1310413869 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 10 November 2022 14:54:18 UTC