Extension pageAction icons are displayed incorrectly
-
Related issue: VB-89093
I recently learned the bug report I submitted was rejected for some reason. There's actually two closely-related issues in there, and I believe at least one of them should be considered a bug that's worth fixing:
- Page Actions no longer work the way they used to
- If that change was intentional, they're still missing important functionality in Vivaldi that's present in Chrome
Obviously, #1 is my preferred interpretation. But even if that's rejected, #2 remains. Since I apparently need to elaborate further, I may as well go into some detail on both.
First, a quick history: Chrome originally supported two different types of icons for extensions: Page Actions (not to be confused with the Vivaldi feature of the same name) and Browser Actions. In the example below, the RSS icon on the left is a Page Action, and the 4-square icon on the right is a Browser Action:
Page Actions are displayed inside the address bar instead of next to it, and can automatically hide themselves completely when they're not relevant (in the example above, the RSS icon would only appear on pages that have an associated RSS feed.
The Chrome developers decided to effectively remove Page Actions back in 2016, their reasoning being that users don't know what extensions they've installed, and therefore all extension icons should always be shown in a single location. After this, extensions that used a Page Action would have their icon mixed in with all the other installed extensions, and rather than hiding when it wasn't needed, it would simply be grayed out. This change was not entirely well received at the time, and if you ask me, the underlying assumption is an insult to their users as well.
Vivaldi, however, took a different route, and kept Page Actions working normally. This wouldn't have been hard to do, since the
chrome.pageAction.*
API still exists today, and all that actually changed was Chrome's UI. Since Vivaldi builds its own UI from scratch, unlike most other Chromium-based browsers, it actually probably would have been more work to change Page Actions to work in Google's new way. Required effort aside, this made Vivaldi the only Chromium-based browser that still allows third-party extensions to place conditionally-visible icons inside the address bar (of course, Google still has a couple baked into the browser that are allowed to use the old Page Action behavior).I last confirmed this functionality to be present in Vivaldi 2.10. I stopped using Vivaldi for a bit after that due to some other unrelated problems in 2.11 that were dealbreakers for me, but it likely stuck around for at least a little while longer. The next version of Vivaldi I used was 4.1, and somewhere in between those two versions, Page Actions have been broken. I wasn't able to find any mention of their removal in the release notes or anywhere else, but the fact that there's an unrelated Vivaldi-specific feature that's also called Page Actions makes it very difficult to search for, and since I also can't search the project's git history I'm not aware of a way to narrow that window any further.
Since Vivaldi 4.1, and continuing to the most recent version, Vivaldi now seems to treat Page Action icons exactly the same as Browser Actions. This is notably not what Chrome does: In Chrome, calling
chrome.pageAction.hide()
will apply a grayscale effect to the extension's icon in an attempt to indicate that it's not active (extensions with grayscale icons are out of luck, as are colorblind users). Vivaldi does nothing at all, leaving no way to tell which extensions are currently usable. That makes me think that this change may have been an oversight, and the original behavior hopefully may not have been meant for removal at all.When I asked about the status of VB-89093 earlier, @luetage referenced this Chrome blog post from last year about upcoming changes in Manifest V3. MV3 is a widely-criticized change Google has been planning for years that will break every single Chrome extension that's ever been written, much like Firefox's switch from XUL addons to WebExtensions (but with some overlap where both are supported, unlike Firefox's change). It also strips out several other useful APIs, including ones that are relied on by security and privacy-oriented extensions like ad blockers. Among MV3's vocal critics are the Vivaldi team themselves, as of 2019. There was talk back then of forking the MV2 code and retaining support for it even after Google dropped it, which I realize would be a herculean effort, but it's one that I certainly hope someone will take up if Google does end up pressing forward with MV3. Ideally that would be part of a larger open-source effort so other Chromium-based browsers can benefit as well, and Vivaldi could simply inherit its base from that mythical chromium-mv2 fork instead of Google's official branch. That's a project I'd donate to enthusiastically. I'm a big fan of keeping old technology alive, which is very much the opposite of how Google wants the world to work.
MV3 does still maintain the same half-support for Page Actions, just unified with Browser Actions under a single new
chrome.actions
API. Taken on its own, that one step actually makes some sense, since as far as Google is concerned, they've basically been the same thing for the past six years. But like other MV3 changes, it also enforces a declarative approach to "show" and "hide" an extension's icon, meaning you can't use custom logic to show/hide the icon at any time. The declarative version should work for the majority of cases, and is even a better route for many, but as a counterexample, I have an extension I wrote for personal use that shows/hides its icon based partly on a timer. This appears to be impossible under MV3.But all that MV3 stuff is in the future -- maybe it won't even happen at all. Today, MV2 is still supported, and extensions that use the Page Actions API are more broken in Vivaldi than they are in Chrome. Whether the fix is a simple matter of adding a
dimmed
class to the.button-toolbar
element for an extension icon that appliesfilter: grayscale(1)
or actually restoring the more-useful address bar behavior and keeping it around as long as it remains possible, it sure seems like something should be done here.If anyone would like to reproduce this issue themselves, an example of an extension that still uses the Page Action API today is The Camelizer, which should only show its icon when you're on an Amazon website (.com or your region's equivalent). In Chrome, you'll see it switch between colored and grayscale as you switch tabs, while in Vivaldi, nothing changes.