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

Distinction between browser and minimal-ui #1023

Open
frivoal opened this issue Dec 3, 2021 · 10 comments
Open

Distinction between browser and minimal-ui #1023

frivoal opened this issue Dec 3, 2021 · 10 comments

Comments

@frivoal
Copy link
Contributor

frivoal commented Dec 3, 2021

There is no guidance on what the distinction between browser and minimal-ui should be.

  • How is browser different from minimal-ui? The spec doesn't say.
  • If minimal-ui and browser both have the same controls, do both values of display-mode match? What if app manifest was used to explicitly invoke one or the other?
  • Is browser allowed to have fewer controls than minimal-ui? That seems somewhat unlikely in major products like Safari and Chrome, but the spec definition is loose enough that it seems allowed, if a platform's conventions for hyperlinks has less UI than what minimal-ui calls for.
@marcoscaceres
Copy link
Member

marcoscaceres commented Dec 7, 2021

There is no guidance on what the distinction between browser and minimal-ui should be.
How is browser different from minimal-ui? The spec doesn't say.

They are indeed similar... just to get a shared understanding, this has been our working model (apologies this was not clear):

  • "browser" is exactly the same behavior you get if you bookmark a web page: the web application is launched amongst other browser tabs/windows if the web browser is already open - or in a new tab, if the browser wasn't running. To the end-user, "browser" looks and feels exactly like any other web page/application and it's clear that application is running inside the browser: "I can see the web page is running inside Firefox/Chrome/Safari/Edge".

  • "minimal-ui": this launches in its own window but not with other browser tabs or identifiable/browser-branded UI (i.e., it looks like a self contained web application). The UI that is provided is "minimal": like a back/forward/refresh buttons, maybe address bar that is "read-only" and no browser tabs. The user shouldn't be able to say, "it's running in < web browser name here >"... the application is fully "self contained".

If minimal-ui and browser both have the same controls, do both values of display-mode match? What if app manifest was used to explicitly invoke one or the other?

No. Browsers have things like tabs, often clear branding, bookmaking facilities, and other things that "minimal-ui" wouldn't have. Think of it like a bare-bones unbranded browser where you can only view this one web application.

Is browser allowed to have fewer controls than minimal-ui? That seems somewhat unlikely in major products like Safari and Chrome, but the spec definition is loose enough that it seems allowed, if a platform's conventions for hyperlinks has less UI than what minimal-ui calls for.

Browser would always have more controls (i.e., "it's a real browser"). Minimal UI as shown on latest Chrome/Android:
Screen Shot 2021-12-07 at 11 53 08 am

(Provides back in the hardware button, forward, reload, and other useful, but limited, things...)

Hopefully that makes more sense now... happy to coordinate in tightening up that text.

@marcoscaceres
Copy link
Member

In case you have an Android device and want to check the above:
https://wpt.live/appmanifest/display-member/display-member-media-feature-minimal-ui-manual.html

Note that minimal-ui is not supported in iOS.

@frivoal
Copy link
Contributor Author

frivoal commented Dec 7, 2021

Thanks. I think the situation in the general case is pretty clear (at least in intent, I'm not sure the spec wording supports that intent fully). It's the edge cases where it gets a little fuzzy. I think the essence of the question hangs on this sentence of yours:

Browsers have things like tabs, often clear branding, bookmaking facilities, and other things that "minimal-ui" wouldn't have

I'd rephrase it as:

Browsers may have things like tabs, often clear branding, bookmaking facilities, and other things that "minimal-ui" wouldn't typically have.

And the the question is what do you do in the case of a simplistic browser, not meaningfully different from what you'd get from a minimal-ui UA? This isn't necessarily what we expect from a mainstream smartphone, but the concept of a display-mode is meant to be generic, and to apply to any sort of device with a web UA. Not sure the browser on every TV, set-top box, fridge, in-flight-navigation system, etc, is always that full featured.

Even if you just stick to desktop, have a look at the browser offered by https://servo.org/. Sure, it's an experimental browser, with hardly any focus at all on its UI, but it's a browser nonetheless, so it needs to answer that mediaquery somehow. I'd expect the display-mode media feature to match browser, since that's what it does in the typical case of a standalone browser. At the same time, if you actually look at its UI, it's pretty-much what you'd expect for standalone (I cannot find any other UI than CMD+L to open a URL). Should the query match both? Should it not match browser for some reason?

The query is explicitly defined as applying not only based on app manifest mode switching, but also to UAs that match the described mode. So I think we need a bit more.

@marcoscaceres
Copy link
Member

marcoscaceres commented Dec 7, 2021

And the the question is what do you do in the case of a simplistic browser, not meaningfully different from what you'd get from a minimal-ui UA? This isn't necessarily what we expect from a mainstream smartphone, but the concept of a display-mode is meant to be generic, and to apply to any sort of device with a web UA. Not sure the browser on every TV, set-top box, fridge, in-flight-navigation system, etc, is always that full featured.

This is true. But at the same time, UAs are not required to support every display mode (or installable web apps at all). For instance, Firefox only supports installable web applications on mobile (and it doesn't support "minimal-ui").

I'd expect the display-mode media feature to match browser, since that's what it does in the typical case of a standalone browser.

That's correct.

At the same time, if you actually look at its UI, it's pretty-much what you'd expect for standalone (I cannot find any other UI than CMD+L to open a URL). Should the query match both? Should it not match browser for some reason?

It would match "browser". The only time it would match anything else is if the user agent:

  1. has explicitly "applied" the manifest to the web page (i.e., the web manifest is affecting the presentation).
  2. Supported some definition of "minimal-ui" or "standalone".

In other words, because of 1, a regular web page would never match anything but "browser".

The query is explicitly defined as applying not only based on app manifest mode switching, but also to UAs that match the described mode. So I think we need a bit more.

Ok, if it says "but also to UAs that match the described mode" that's definitely a bug. It must only match "standalone", "minimal-ui", or "standalone" iff manifest is applied.

@frivoal
Copy link
Contributor Author

frivoal commented Dec 7, 2021

Ok, if it says "but also to UAs that match the described mode" that's definitely a bug. It must only match when the manifest is applied.

…a regular web page would never match anything but "browser".

Hmmm… the spec looks very explicit to me that a regular web page should occasionally match things other than browser (second paragraph of 7.1):

A user agent MUST expose the 'display-mode' media feature irrespective of whether a manifest is being applied to a browsing context. For example, if the end-user puts the whole user agent into fullscreen, then the user agent would reflect this change to CSS and scripts via the 'display-mode' media feature.

@marcoscaceres
Copy link
Member

Ok, let me check if anyone actually implemented that. It's been a while (years ☺️) since I last checked.

@marcoscaceres
Copy link
Member

marcoscaceres commented Dec 7, 2021

Ah d'oh, you are right! "fullscreen" does indeed do fullscreen in Gecko, and Chrome (but not in Safari).

@marcoscaceres
Copy link
Member

Ok, that's fun ... I guess it's back to better describing these :)

@marcoscaceres
Copy link
Member

marcoscaceres commented Dec 7, 2021

What about if "generally" the "minimal-ui" mapped to window.open() with windowFeatures set to "popup".

Per HTML:

"popup"
Encourages user agents to provide a minimal web browser user interface for the new window. (Impacts the visible getter on all BarProp objects as well.)

I kinda like that... it gives a nice mapping and is an explicit distinction between "browser" (regular window/tab) and "minimal-ui".

It's also easy to implement (famous last words), because you can check it/set it when the popup window is constructed.

@aarongustafson
Copy link
Collaborator

@marcoscaceres I’d be down with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants