tosdr/browser-extensions

Use browserAction instead of pageAction

Closed this issue · 1 comments

Consider replacing pageAction with browserAction.

The benefit of this would be the ability to use browserAction.setBadgeText and browserAction.setBadgeBackgroundColor as a replacement for the badge icons currently used for showing the rating label.

It follows similar UI patterns that users are accustomed to from ad blockers showing a count as a badge next to the extension icon.

This removes the burden of having to maintain the generic label images at the right DPI for all current and future displays.

It also has the benefit of maintaining a visual reference to which extension to attribute this information (ToS;DR). Right now, the ToS;DR extension icon is either grayed-out or completely replaced by the badge, thus losing the visual connection and sometimes confusing what the icon represents alongside generic icons of other browser extensions.

I don't know if there was an explicit reason to use a pageAction instead of a browserAction to begin with. On the surface, it seems that both APIs could serve the existing use case well.

Vinnl commented

One potential reason is that pageAction, in Firefox, appears in the address bar, whereas browserAction appears as a regular browser chrome toolbar - in Chrome, the latter happens for both. Since the ratings apply to the current page, rather than the browser as a whole, that makes more sense semantically, but the practical result of how confusing the bade is is, of course, relevant as well.