Skip to content

Add always-on-top explainer - #163

Merged
michaelwasserman merged 2 commits into
w3c:mainfrom
steimelchrome:always-on-top-explainer
Aug 28, 2026
Merged

michaelwasserman merged 2 commits into
w3c:mainfrom
steimelchrome:always-on-top-explainer

Conversation

@steimelchrome

Copy link
Copy Markdown
Contributor

@michaelwasserman michaelwasserman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly lg, but please consider addressing some comments first. (not all are blocking, feel free to ack and punt/ignore).

Comment thread EXPLAINER_always_on_top.md Outdated
Comment thread EXPLAINER_always_on_top.md Outdated

## 2. Use Cases & User Motivation

There are several key productivity and utility use cases where users benefit from persistent, always-on-top windows:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All three use cases mention presenting the window on top of full-screen content. While that might be a fairly strong requirement, would an implementation that z-ordered these windows beneath full screen content be adequate?

Should the explainer mention anything about how macOS WMs switch spaces when content enters fullscreen, and how these windows should either move between spaces, or remain on the original space?

* **Permission Requirement:** This capability is gated behind the `window-management` permission. If this permission has not been granted by the user, the `alwaysOnTop` request is silently ignored, and a standard popup window is created instead.
* If `true` and the required permission is granted, the OS-level window manager is instructed to keep this window pinned above other non-always-on-top windows.
* **Z-Ordering of Multiple Windows:** The relative z-ordering between multiple concurrent always-on-top windows is left to the User Agent or the underlying operating system. For example, UAs may order them based on which window was most recently focused.
* **UA-Defined Limits:** To preserve usability, browsers (User Agents) may enforce implementation-specific limits. For example, UAs may restrict origins to a single active `alwaysOnTop` window at a time, or make it mutually exclusive with other types of Picture-in-Picture (PiP) windows. The UA may also restrict the size of the always-on-top window.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is interesting and perhaps surprising. I think it merits additional detail in the security section, or elsewhere that might talk about abuse mitigation, or secure usability protections

Comment thread EXPLAINER_always_on_top.md Outdated
Comment thread EXPLAINER_always_on_top.md Outdated
* Requiring both the requestable `window-management` permission and explicit user activation constitutes a very high bar that prevents untrusted or malicious sites from spamming pinned windows.
* **Move & Resize Restrictions:** To prevent abuse scenarios like a window programmatically tracking the cursor or expanding to obscure critical OS interface elements, synchronous APIs that manipulate window bounds (`moveTo`, `moveBy`, `resizeTo`, `resizeBy`) are subject to strict UA rate limits and transient user activation checks, analogous to the mitigations applied to Document Picture-in-Picture windows.
* **Focus Stealing Protections:** Always-on-top windows must not be permitted to aggressively force focus back to themselves when the user interacts with other applications.
* **Explicit User Affordance & Easy Dismissal:** The browser and operating system window frames must provide clear, un-spoofable user controls to dismiss the window at any time.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder how this pairs up with unframed windows, but maybe the considerations are different there, since it's also specific to isolated web contexts, IIUC

Comment thread EXPLAINER_always_on_top.md Outdated
Comment thread EXPLAINER_always_on_top.md Outdated

### Native Packaging (Electron / NW.js)

Currently, web developers building tools requiring persistent always-on-top capabilities (such as companion note-taking apps, trading dashboards, or screen annotation widgets) are forced to wrap their applications in desktop runtimes like Electron just to access APIs like `BrowserWindow.setAlwaysOnTop()`. Providing this capability natively on the web platform bridges a critical capabilities gap, eliminating the need to bundle dedicated native runtime binaries. No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great point, it might even merit a brief mention earlier in the doc


---

## 5. Security & Privacy Considerations

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please plan to add a corresponding security_and_privacy_ companion markdown file, using the latest W3C questionnaire template

@steimelchrome

Copy link
Copy Markdown
Contributor Author

Per offline discussion, I'll resolve the rest of the comments in a followup PR

@michaelwasserman
michaelwasserman merged commit d7c46f7 into w3c:main Aug 28, 2026
2 checks passed
github-actions Bot added a commit that referenced this pull request Aug 28, 2026
SHA: d7c46f7
Reason: push, by michaelwasserman

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants