[mediacapture-main] `beforeunload` prompt should display for active Media Capture sessions (#1013)

thexeos has just created a new issue for https://github.com/w3c/mediacapture-main:

== `beforeunload` prompt should display for active Media Capture sessions ==
Feature request proposing a change to `beforeunload` firing behavior was filed in WHATWG repo: https://github.com/whatwg/html/issues/10627

WHATWG proposal summary: current `beforeunload` would not show "Are you sure you want to close this page?" dialog unless user had clicked/typed inside the Document. However, Media Capture allows `getUserMedia()` to succeed without such prior user activation. As a result, one could develop a web application that joins a conference call immediately upon page load, but afterwards can't prevent the user from accidentally closing the tab/window/PWA with an active call.

To facilitate correct `beforeunload` prompt behavior, it is likely that Media Capture amendments will be necessary.

The proposed WHATWG change would rely on detecting active Media Capture session. Furthermore, to prevent abusive `beforeunload` prompts a minimum Media Capture session duration should be considered (e.g., during first 15 seconds of "activationless" Media Capture, user can close the page without seeing the `beforeunload` prompt - note that the countdown must being from getUserMedia() resolving).

Current Media Capture specs don't expose any standard ways to determine:
1. That an active Media Capture session is ongoing for a Document (e.g., if any of the local devices are attached to a live MediaStreamTrack in mediaDevices's relevant global object's associated Document)
2. When MediaStreamTrack was created

Those would likely have to be specified in order to define correct 'beforeunload' prompt behavior.

Ref: https://issues.chromium.org/issues/40704936#comment9

Please view or discuss this issue at https://github.com/w3c/mediacapture-main/issues/1013 using your GitHub account


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

Received on Sunday, 15 September 2024 23:46:10 UTC