Proposal: extend chrome.action API to display popover in the middle of the screen

146 views
Skip to first unread message

Nikita Vasilyev

unread,
Oct 27, 2022, 5:33:55 PM10/27/22
to Chromium Extensions
I propose to extend chrome.action API to allow displaying popup in the middle of the browser screen, instead of the top right corner.

Popular extensions, such as Omni, inject a content script on every single website only to display a popover in the middle of the screen. This is bad for several reasons:
excessive permissions, doesn't work at all on the new tab page (and the rest of chrome:// pages), the popover code can break the website, and the website code can break the popover.

I propose a small addition to the existing API:

{
  "action": {
    "default_popup": "popup.html",
    "default_position": "center"
  }
}

chrome.action.setPopup({
  popup: "popup.html",
  position: chrome.action.Position.CENTER
})


This would center the popover in the middle both vertically and horizontally. This would allow reimplementing extensions such as Omni in a more sensible way.

Stefan Van Damme

unread,
Oct 28, 2022, 2:17:27 AM10/28/22
to Chromium Extensions, m...@elv1s.ru
Hi there,

For everyone, this proposal has also been added to the W3 browser extension group:
https://github.com/w3c/webextensions/issues/307
So you can discuss it on that web page.

Thanks,
Stefan vd
Reply all
Reply to author
Forward
0 new messages