mozilla / standards-positions

https://mozilla.github.io/standards-positions/
Mozilla Public License 2.0
651 stars 72 forks source link

Additional Windowing Controls #712

Open ivansandrk opened 1 year ago

ivansandrk commented 1 year ago

Request for Mozilla Position on an Emerging Web Specification

Introduction

This proposal introduces additional ways for web applications to introspect and control their windows, to enable critical window management functionality on the web platform.

The proposed enhancement would allow web applications to maximize, minimize, and restore their windows and introspect that window display state. Further, it allows applications to be notified when the window is repositioned, and control whether the window can be resized. The window placement permission will be required for these capabilities.

Problem and Use Cases

Virtual Desktop Infrastructure (VDI) web clients have limited abilities to integrate remote application windows with the local desktop environment, which creates suboptimal experiences for their users. Currently, they can only present full disjoint remote desktop environments (e.g. in a local fullscreen window), or present individual remote applications in separate local windows with titlebar window controls that are inoperative, redundant, and confusing for users.

Several VDI clients, including Citrix and VMWare, have reported that their users strongly desire an integrated experience as their work is increasingly happening both on local client and remote host devices.

Unfortunately, the web platform offers no means for web applications to signal the user agent when users interact with remote application (or custom) window controls. Further, web applications cannot introspect the local window’s display state, and must poll for local window position changes. These platform gaps create disconnects between local and remote windows, and prevent web VDI clients from offering functionality expected by users.

These missing capabilities also prevent a broader set of web applications from offering compelling window management experiences for their users.

Proposal

This proposal seeks to enable local web applications to convey a user’s intended window control interactions with remote (or custom) window controls. Summary of the API proposals, which are generally gated by Window Management (“window-placement”) permission:

Use cases explored here also rely upon a parallel effort to standardize the existing CSS property -webkit-app-region/app-region.

bgrins commented 1 year ago

The Problem and Use Cases section in the explainer talks about VDI web clients (specifically Citrix and VMWare), but also says:

These missing capabilities also prevent a broader set of web applications from offering compelling window management experiences for their users

Can you say more about what those additional use cases are?

tomrittervg commented 1 year ago

(no hats) I am generally concerned about leaking data about anything outside the layout viewport. This would include with width of browser chrome (outerWidth, outerHeight, screen.height, etc) and position of the window on the monitor. I know other browsers have been lying about these values (setting them to the same as the inner browser values) and I've never seen any breakage reports - I would love to get to a point where these values were only exposed when a site was granted this special permission.

michaelwasserman commented 1 year ago

@bgrins: Medical web app developers requested these controls for managing patient-specific windows: https://github.com/w3c/window-placement/issues/3#issuecomment-640871030. Multi-window chat apps, financial dashboards, creative suites, etc. would benefit from similar controls.

@tomrittervg: I also hope we could further limit info and controls without explicit permission! See related suggestions in the window-management (née window-placement) spec and security_and_privacy.md questionnaire.

emilio commented 1 year ago

This is something that by design won't work on Wayland right?

michaelwasserman commented 1 year ago

Client application window controls may indeed be limited by the OS, Window Manager, protocols, utilities, and modalities. The API surface offers coherent behavior in a variety of windowing environments, with opportunities to gracefully fallback or no-op when operations are not supported. Wayland offers some relevant xdg_toplevel APIs, but does indeed limit functionality in this space.

sonkkeli commented 1 year ago

Hey, I'm jumping in here as I'm continuing on Ivan's work.

There were some updates made on the proposed APIs and the current proposals are the following:

The explainer has also been updated with the new API proposals.

Additionally the JS APIs are proposed to be gated behind the existing window-management permission.