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

Always on Top window #443

Open
hanguokai opened this issue Aug 22, 2023 · 5 comments
Open

Always on Top window #443

hanguokai opened this issue Aug 22, 2023 · 5 comments
Labels
discussion Needs further discussion opposed: safari Opposed by Safari

Comments

@hanguokai
Copy link
Member

This is a discussion or feature request.

Desired Functionality

Like video picture-in-picture function, it is useful for extensions to be able to create a small window that always be displayed on top of other contents/windows.

Related Web API

Major browsers support picture-in-picture API. But it is only for video element, so it is not useful for other use cases.

Since Chrome 116, there is a new Document Picture-in-Picture API. This is very close to my goal, but I find that it currently has the following limitations:

  • In theory, it may support multiple pip windows, but currently it supports only one pip window for all web pages and extensions. That means, if one extension opens a pip window, now another extension opens a pip window, the previous pip window will be closed first. See issue-27. I hope it could support for multiple pip window for extensions, or guarantee one pip window per extension.
  • It works only for extension pages that are opened in browser tabs, not working for popup page, side panel page and offscreen documents. See issue-88. I hope it can be used in offscreen documents, thus extensions don't need to open a visible tab to use it.

Related Extension API

bowser.windows.Window has a alwaysOnTop property, but it can't be specified in windows.create() method. Developers often expect this feature and then think of this property. Existing feature requests https://crbug.com/933215 and https://crbug.com/822425.

@hanguokai hanguokai added discussion Needs further discussion and removed needs-triage labels Aug 22, 2023
@bershanskiy
Copy link
Member

In Firefox, extensions are able to create an always-on-top window by using the windows.create() with type set to popup. Perhaps, a compatible change in Chromium would make sense?

@hanguokai
Copy link
Member Author

In Firefox, extensions are able to create an always-on-top window by using the windows.create() with type set to popup.

A popup window created by browser.windows.create({ url: "https://example.com", type: 'popup' }) is not a always-on-top window.

@xeenon xeenon added the opposed: safari Opposed by Safari label Aug 31, 2023
@xeenon
Copy link
Collaborator

xeenon commented Aug 31, 2023

I am primarily opposed to this due to concern that extensions could abuse this.

@hanguokai
Copy link
Member Author

At today's meeting, due to time constraints, we talked about some history about "always on top" window and some concerns. Discussions can continue later, such as

  1. how to better support and improve this function in Chrome for extension
  2. how to resolve the concern.

The reason why I created this issue at this time (August 2023) is because Chrome 116 recently introduced a new API, Document Picture-in-Picture, which has already enabled web and extensions to support "always on top" window. Thanks this API.

Here is the position about Document Picture-in-Picture API: Safari's position and Firefox's position.

@hanguokai
Copy link
Member Author

Simeon said at the meeting:

In the past I investigated why the chrome.app API supported this and the extension APIs don't. Mainly installs and use cases. Chrome is of course concerned about abuse cases and what's always on top. That said, I defer to the current Chrome team for their stance.

In the past, chrome.app.window api allowed to create an always on top window, which require the alwaysOnTopWindows permission. Now that Chrome App has been removed, maybe this feature can be handed over to extensions? This is an alternative solution to Document PiP API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Needs further discussion opposed: safari Opposed by Safari
Projects
None yet
Development

No branches or pull requests

3 participants