Open Bug 1140819 Opened 9 years ago Updated 2 years ago

There is no obvious way to exit fullscreen on a tablet when the app doesn't do it

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows 8
defect

Tracking

()

People

(Reporter: ajones, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

(Keywords: csectype-spoof, sec-want)

Attachments

(1 file)

On desktop you can always use the Esc key to exit fullscreen. When YouTube gives an error there is no way to exit from fullscreen other than terminating Firefox in the task manager.
Blocks: 1121280
Depends on: 1123170
What about IE and Chrome?
In Chrome you move the cursor to the top of the screen and a link drops down.
It seems IE exits fullscreen when "Win" is pressed. I guess we can also do that on Windows to solve this problem. But I guess for the current status, the better temporary solution would be adding a button in the dialog which appears when we lose the focus and get it again. That dialog says you can exit fullscreen anytime with ESC, but doesn't provide any button on it to exit.
No longer depends on: 1123170
I can't reproduce this on youtube although I'm not able to reproduce a youtube error. 

STR:

1) load a youtube html5 video - https://www.youtube.com/watch?v=ngElkyQ6Rhs
2) go into fullscreen
3) approve the prompt and check always remember
4) exit fullscreen
5) enter fullscreen
6) hit escape

result: firefox exits fullscreen
On tablet, you don't always have keyborad, then you can only exit fullscreen when the page provides. If the page doesn't provide any button to exit fullscreen, you won't be able to exit fullscreen.
(In reply to Xidorn Quan [:xidorn] (UTC+12) from comment #5)
> On tablet, you don't always have keyborad, then you can only exit fullscreen
> when the page provides. If the page doesn't provide any button to exit
> fullscreen, you won't be able to exit fullscreen.

Totally sympathetic to an issue like this. If you hit the big Windows key, presumably we flip back to the start screen? Then if you hit it again, we flip back to the dom fullscreen window of firefox?
(In reply to Jim Mathies [:jimm] from comment #6)
> Totally sympathetic to an issue like this. If you hit the big Windows key,
> presumably we flip back to the start screen? Then if you hit it again, we
> flip back to the dom fullscreen window of firefox?

Currently, yes. Even we can switch to other app, without keyboard, we have no way to exit from dom fullscreen other than completely exit Firefox itself.

We can either make win key a shortcut to exit fullscreen (which is what I'm going to do), or simply make the warning after refocus clickable (which probably will also be done after bug 1129061).
(In reply to Xidorn Quan [:xidorn] (UTC+12) from comment #7)
> (In reply to Jim Mathies [:jimm] from comment #6)
> > Totally sympathetic to an issue like this. If you hit the big Windows key,
> > presumably we flip back to the start screen? Then if you hit it again, we
> > flip back to the dom fullscreen window of firefox?
> 
> Currently, yes. Even we can switch to other app, without keyboard, we have
> no way to exit from dom fullscreen other than completely exit Firefox itself.
> 
> We can either make win key a shortcut to exit fullscreen (which is what I'm
> going to do), or simply make the warning after refocus clickable (which
> probably will also be done after bug 1129061).

I like the idea of using the win key. In order to reproduce the focus problem, do you have a wip that implements the win key fix you can post?
Yes, I have, but it is not handy at present... Will probably post tomorrow morning.
Wouldn't using the Windows key be a problem because it takes you to the start screen? As part of the work on bug 1129061 I've been considering using a swipe down from the top of the screen to bring back a dialog with an exit button you can tap.
(In reply to Verdi [:verdi] from comment #10)
> Wouldn't using the Windows key be a problem because it takes you to the
> start screen? As part of the work on bug 1129061 I've been considering using
> a swipe down from the top of the screen to bring back a dialog with an exit
> button you can tap.

Partial swipe ('edge') gestures are tied to displaying immersive application chrome, and a full swipe gesture closes the application. I don't think either of these fits for closing of a dialog or fullscreen child window.
ah! sorry!

"I've been considering using a swipe down from the top of the screen to bring back a dialog with an exit button you can tap."

I should have read more closely.. yes this fits the edge gesture.
I really like the edge gesture idea, although without winrt widget as a backend I'm not sure we can get good results trying to detect it. Verdi, what's your timeframe on bug 1129061? Should we land a temporary work around or wait on your experimenting?
Flags: needinfo?(mverdi)
Comment on attachment 8594178 [details] [diff] [review]
patch 2 - Add win key as shortcut to exit fullscreen on windows

I'm not a browser peer and I don't know this code well, you should flag a front end person on the review. Maybe we land this as a temp workaround and work on the edge stuff later, not sure.
Attachment #8594178 - Flags: feedback?(jmathies) → feedback+
(In reply to Jim Mathies [:jimm] from comment #14)
> I really like the edge gesture idea, although without winrt widget as a
> backend I'm not sure we can get good results trying to detect it. 

I don't know what "without winrt widget as a backend" means but we used this gesture once in metro Firefox to open the tab tray. I don't know if that applies here.


> Verdi,
> what's your timeframe on bug 1129061? Should we land a temporary work around
> or wait on your experimenting?

I'm trying to have that finished up in the next week. 

If the windows key is used for returning to the start screen how will work in this case? I'm in full screen and want to go to the start screen, what happens? I'm taken out of full screen and left on the desktop instead of the start screen (only in Firefox)?
Flags: needinfo?(mverdi)
> I don't know what "without winrt widget as a backend" means but we used this
> gesture once in metro Firefox to open the tab tray. I don't know if that
> applies here.

The code that did that leveraged a widget backend that only metrofx had access too. That project is dead (see bug 1039866). We would have to find a "desktopish" way of detecting this, maybe even through front end js looking for touchevents that cross screen boundaries. Not sure if that would work or not.

> > Verdi,
> > what's your timeframe on bug 1129061? Should we land a temporary work around
> > or wait on your experimenting?
> 
> I'm trying to have that finished up in the next week. 
> 
> If the windows key is used for returning to the start screen how will work
> in this case? I'm in full screen and want to go to the start screen, what
> happens? I'm taken out of full screen and left on the desktop instead of the
> start screen (only in Firefox)?

I think this solution would have to do something like this:

On edge gesture detected:
 if in fullscreen:
  bring up fullscreen ui
  cancel key event
 else:
  let windows handle handle key event

Not a fan, but I'm not a UX person in charge of this stuff. ;P
(In reply to Verdi [:verdi] from comment #16)
> If the windows key is used for returning to the start screen how will work
> in this case? I'm in full screen and want to go to the start screen, what
> happens? I'm taken out of full screen and left on the desktop instead of the
> start screen (only in Firefox)?

The start screen will open, and at the same time, Firefox exits fullscreen in background. So user will see Firefox in normal state after returning from the start screen.
I think the gesture approach would be very helpful. This has been coming up from time to time on SuMo and the arduous process of calling up the virtual keyboard to tap F11 is the only thing that has worked so far:

https://support.mozilla.org/questions/1041688
https://support.mozilla.org/questions/1055583
https://support.mozilla.org/questions/1064932
https://support.mozilla.org/questions/1074478
Depends on: 1160023
Depends on: 1190737
Component: DOM → DOM: Core & HTML

Is anybody still watching this? I just made the mistake of going to fullscreen on a tablet device and had to hook up a keyboard to get out.

Chrome had the same problem, and I think they eventually caved and put a "exit fullscreen" item on the default context menu, when fullscreen is active. Seems like the least painful solution.

(In reply to James B from comment #20)

Is anybody still watching this? I just made the mistake of going to fullscreen on a tablet device and had to hook up a keyboard to get out.

Chrome had the same problem, and I think they eventually caved and put a "exit fullscreen" item on the default context menu, when fullscreen is active. Seems like the least painful solution.

Hey, based on your comment in bug 1190737 comment 1, I guess you are talking about the browser fullscreen mode (which you can enter via the fullscreen button under the hamburger menu), however, this bug is more about what should happen for a website using Fullscreen API to enter fullscreen state.

These are two different scenarios.

Normal websites supporting fullscreen also provides their own way to exit fullscreen (like YouTube's fullscreen switch button on the bottom right corner), so browser providing an escape approach is generally considered a security measure to avoid malicious (or ill-designed) websites to hold user hostage from using the browser. Thus the measure needs to always be available, but shouldn't affect the legitimate web functionalities.

Adding "exit fullscreen" to the context menu doesn't work in this scenario, because a malicious website looking on locking user's browser can easily prevent context menu from opening. Banning website from doing that under fullscreen would harm legitimate websites, which becomes a more complex problem. So while this might be a great idea for exiting the browser fullscreen mode, it is not an acceptable solution as itself in the context of this bug.

I suggest you file a separate bug with the proposed solution for the browser fullscreen mode, and that can be assessed separately.

However, given your comment in bug 1190737:

I just tried this and the problem is that when a Windows 10 device is in Tablet Mode, swiping from the top is a reserved system gesture. ... I don't think it's possible to disable these gestures. I was able to eventually activate the Firefox drag-down gesture but it took a bunch of tries.

It sounds like swiping from the top may not be a feasible solution for this issue either, so maybe we should just go with making Win button serve as an escape.

I don't currently have bandwidth working on this, unfortunately, but if everyone agrees on using Win button, then the old patch could be a good start point, and I can look into it later. ni? myself for this.

Flags: needinfo?(xidorn+moz)

FYI the device I'm using (Surface Book 2) doesn't have a hardware Windows key on the tablet portion, and doesn't show the taskbar / Windows button while Firefox is full-screen. The system swipe-from-left gesture brings up the application switching overview (same as WIN + Tab) but I don't know if the application being switched away from gets any kind of notification.

(In reply to James B from comment #23)

FYI the device I'm using (Surface Book 2) doesn't have a hardware Windows key on the tablet portion, and doesn't show the taskbar / Windows button while Firefox is full-screen.

Oops... then I have no idea what can we do then...

The system swipe-from-left gesture brings up the application switching overview (same as WIN + Tab) but I don't know if the application being switched away from gets any kind of notification.

I suspect that we would still get a blur event or something like that, but I doubt we can make use of that, as exiting fullscreen when losing focus on desktop may be too offensive...

Flags: needinfo?(xidorn+moz)

That's a real pickle. The OS reserves three of the four swipe gestures (from left, top, right) and I understand not wanting to overload tap / hold on the content area.

Maybe you could use this API to check if the OS is running in Tablet Mode, and only then, exit fullscreen on blur?

I just tried this and the problem is that when a Windows 10 device is in Tablet Mode, swiping from the top is a reserved system gesture. ... I don't think it's possible to disable these gestures. I was able to eventually activate the Firefox drag-down gesture but it took a bunch of tries.

It sounds like swiping from the top may not be a feasible solution for this issue either, so maybe we should just go with making Win button serve as an escape.

Hello, everybody. Swiping from top would work. The system gesture you mentioned is different. Here, swiping down from the upper edge of the screen gently would work. I made an add-on https://addons.mozilla.org/cs/firefox/addon/swipe-to-exit-fullscreen/ for this.
It works like this: a content script places a touchstart and touchend event and a background script makes the window maximized.
The paramatres are: touchstart x less than height * 0.15 (I don't know the exact value right now) and movement on x is bigger than 10. As a safety measure, touchend should be above height * 0.3 to avoid gesture collision. I've tested it and it works very well on my tablet. However, it would be much as a native feature (no limitations like going fullscreen in the pdf reader). What do you think?

*much better

I just had a follow-up thought to my previous comment. Xidorn said that exiting fullscreen on blur might be "offensive." I would broadly agree, but what if you use WMI to check how many displays are attached? Then, you could exit fullscreen on blur only when there's a single monitor. That addresses the only use case I can think of where staying fullscreen makes sense, which is to fullscreen something on one display while you're doing other work on another. If I alt-tab between a fullscreen application and another window, all on one display, and doing so makes the fullscreen application go to windowed mode, I don't think it would bother me.

Did you try my add-on?

I think that the solution here is to make a gesture. Swipe down from the top edge on the screen to see the tab bar, just like when you hover your mouse to the top of the screen on a desktop computer. Microsoft Edge does it this way.

Then click the maximize button.

(In reply to James B from comment #28)

I just had a follow-up thought to my previous comment. Xidorn said that exiting fullscreen on blur might be "offensive." I would broadly agree, but what if you use WMI to check how many displays are attached? Then, you could exit fullscreen on blur only when there's a single monitor. That addresses the only use case I can think of where staying fullscreen makes sense, which is to fullscreen something on one display while you're doing other work on another. If I alt-tab between a fullscreen application and another window, all on one display, and doing so makes the fullscreen application go to windowed mode, I don't think it would bother me.

How about switching between two full screen applications?

(In reply to petr.laskevic from comment #26)

I just tried this and the problem is that when a Windows 10 device is in Tablet Mode, swiping from the top is a reserved system gesture. ... I don't think it's possible to disable these gestures. I was able to eventually activate the Firefox drag-down gesture but it took a bunch of tries.

It sounds like swiping from the top may not be a feasible solution for this issue either, so maybe we should just go with making Win button serve as an escape.

Hello, everybody. Swiping from top would work. The system gesture you mentioned is different. Here, swiping down from the upper edge of the screen gently would work. I made an add-on https://addons.mozilla.org/cs/firefox/addon/swipe-to-exit-fullscreen/ for this.
It works like this: a content script places a touchstart and touchend event and a background script makes the window maximized.
The paramatres are: touchstart x less than height * 0.15 (I don't know the exact value right now) and movement on x is bigger than 10. As a safety measure, touchend should be above height * 0.3 to avoid gesture collision. I've tested it and it works very well on my tablet. However, it would be much as a native feature (no limitations like going fullscreen in the pdf reader). What do you think?
I meant y of course.

(In reply to petr.laskevic from comment #32)

(In reply to James B from comment #28)

If I alt-tab between a fullscreen application and another window, all on one display, and doing so makes the fullscreen application go to windowed mode, I don't think it would bother me.

How about switching between two full screen applications?

Hrm. I can't say that I've ever tried to do this, at least with a single display. I'm trying to picture a use-case. Say that I have a full-screen video player set up in the background, tab out and start a presentation (also full screen), then partway through the presentation tab back to the video. If any of those switches pushed the fullscreen application back to windowed, it doesn't seem like that would be a big problem.

Of course, I'm just one data point, maybe you'd need to do some research to see what the "common" reaction might be. I would argue, though, that if the only alternative is for the application to require a gesture to exit -- a gesture that I think hasn't been implemented in the core browser, and one that you'd have to somehow hint to the users through the UI -- then we should err on the side of exiting too frequently.

You could alt-tab between Firefox and a text editor (for example Sublime Text or Word or Writer). When you code or write documents on a laptop/tablet, you need the most vertical space, so all apps in fullscreen. One point to consider is that not all tablets have a Windows button. Also gestures are natural on tablets. You can swipe from the left side to switch between programs, swipe from the right side to view notifications in Windows 10.

For example Microsoft Edge has the gesture that I'm talking about and it works. Also there are some gestures in Firefox - pinch to zoom for example. So you can implement gestures.

Also, when a user uses the Windows button, they want to see the Start menu.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: