Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow fullscreen on already fullscreen elements without user activation #193

Closed
quisquous opened this issue Jun 17, 2021 · 10 comments
Closed

Comments

@quisquous
Copy link

@mustaqahmed requested that I file an issue for this.

In this text, I'm proposing that we add some text that requesting fullscreen on an already fullscreened element does not require nor consume user activation. This is currently how Chrome behaves, and so clarifying this text would be useful.

Additionally, as a part of window placement, we would like to extend requestFullscreen to have an additional screen parameter to open up fullscreen on a different display. Rerequesting fullscreen with a different screen will move the window to another screen (preserving fullscreen). Having this text would allow us to not require user activation for this behavior, solving this bug.

@mustaqahmed
Copy link

I just confirmed that Firefox work exactly like Chrome: if an element is already fullscreen, calling element.requestFullscreen() again without user activation is a no-op from user's perspective (nothing changes) but the Promise is rejected and a console error is emitted. It seems to me that silently accepting the Promise in this particular case would be a no-change for users, and a very subtle change for developers. In particular, the lack of a fullscreenchange event would still indicate to developers that nothing has changed.

blueboxd pushed a commit to blueboxd/chromium-legacy that referenced this issue Jul 3, 2021
This is the browser change that corresponds to this renderer change:
https://chromium-review.googlesource.com/c/chromium/src/+/2970683

This spec change is filed here:
whatwg/fullscreen#193

Bug: 1218483
Change-Id: I93337d9b74bb8475c631edb6f34b363510206a36
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2998308
Reviewed-by: Camille Lamy <[email protected]>
Commit-Queue: enne <[email protected]>
Cr-Commit-Position: refs/heads/master@{#898323}
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this issue Oct 14, 2022
This will allow an already fullscreen element to switch displays
(with window-placement permission) without requiring an additional
user activation.  This is similar to how moveTo behaves.

Filed here: whatwg/fullscreen#193

Bug: 1218483
Change-Id: Ia793eccb7e3f25492690c703025f7e975b597ccf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2970683
Reviewed-by: Mustaq Ahmed <[email protected]>
Commit-Queue: enne <[email protected]>
Cr-Commit-Position: refs/heads/master@{#897516}
NOKEYCHECK=True
GitOrigin-RevId: c17358d64ea9ee12cce4d136ac41dc7b1b90421c
@mustaqahmed
Copy link

I now feel like I misinterpreted the original request here: this is asking to drop the user activation requirement if Document.fullscreenElement is not null.

FYI for @bradtriebwasser @michaelwasserman.

@michaelwasserman
Copy link

Indeed, see supportive statements in this related comment thread on the PR adding user activation consumption to requestFullscreen.

IMO, it seems totally reasonable to grant fullscreen element changes without user activation.
Whether or not we'd allow fullscreen display changes without user activation is less straightforward.
The original Chromium bug was fixed by adding support for fullscreen capability delegation

@foolip
Copy link
Member

foolip commented Nov 24, 2022

One case I'm not sure about is nested fullscreen with iframes. If myblog.com embeds videohosting.com in an iframe and the user fullscreens a video in the iframe, myblog.com could later overlay or replace the video, although it couldn't mute and unmute the audio. If myblog.com is hostile there are already plenty of bad things it can do, but a seamless transition between the real videohosting.com and something else might be new.

I'm not sure if this is important or not, but it would be good to look into.

@mustaqahmed
Copy link

Yes, good catch that we need to avoid seamless fullscreen transition between two different origins.

Perhaps we can say: elem.requestFullscreen() will require either:

  • transient user activation (as we currently have in Step 5 here), or
  • Document.fullscreenElement.ownerDocument === elem.ownerDocument.

@foolip What do you think?

Any chance an easier answer lies in the "relevant global object" in Step 5 above? The call elem.requestFullscreen() cannot be made from a cross-origin Window because that Window can't access elem---at least in Chrome. I don't know if this site isolation behavior is fully spec-ed. @domenic?

@annevk
Copy link
Member

annevk commented Nov 25, 2022

@mustaqahmed well with document.domain it can be, right? (The security model is specified in HTML and while it predates site isolation, it comes down to the same thing, roughly.)

@foolip
Copy link
Member

foolip commented Nov 25, 2022

In order to avoid issues with iframes, I think the simplest fix would be to require that there's no iframe on the fullscreen element stack.

@annevk
Copy link
Member

annevk commented Nov 25, 2022

Could someone perhaps clarify the objectives from OP? And perhaps open a separate issue for the second paragraph as that seems rather separate?

@foolip
Copy link
Member

foolip commented Nov 25, 2022

@quisquous can you elaborate on the motivation?

@michaelwasserman
Copy link

michaelwasserman commented Dec 1, 2022

It's okay to close this issue for now, and folks can reopen it if the need arises.

The original motivation was moving a fullscreen element to another display of the device (by calling requestFullscreen with a new target screen in the FullscreenOptions dictionary, as supported by Chrome), when triggered by a click on a separate window. That was made possible via Capability Delegation of Fullscreen requests.

Just FYI, @quisquous is no longer actively working in this space.

@annevk annevk closed this as completed Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants