4
  1. Default icons (16 & 32) are specified in manifest.json
  2. Use browser.browserAction.setIcon({tabId, imageData}) to change the icon.

It should work like Chrome and Firefox.
However, in Orion, it is not working.

Version 0.99.126.3-beta (WebKit 618.1.2)

Monterey (12)


Example:


            function getImageData() {
                let canvas = document.createElement("canvas");
                let ctx = canvas.getContext("2d");
              
                ctx.fillStyle = "green";
                ctx.fillRect(10, 10, 100, 100);
              
                return ctx.getImageData(50, 50, 100, 100);
              }

chrome.browserAction.setIcon({imageData:getImageData()})

This works in Chrome but not in Orion.


@Vlad Before fixing the issue officially, I would like to implement a detection of Orion browser to solve the icon display issue in Violentmonkey. Hope you can answer few questions from Violentmonkey's developer. See https://github.com/violentmonkey/violentmonkey/pull/1971


The extension with this issue:

https://github.com/violentmonkey/violentmonkey/actions/runs/7059927181
Violentmonkey-test-webext-v2.16.1-7-gc30b5d0.zip

The extension icon could not be updated dynamically. It is always grey.
However, the badge count text can be updated correctly.
I have tried to omit the imageData (cached image), and it can work as normal.

  • dino replied to this.

    cyfung1031 Thanks for reporting this, we were parsing ImageData wrongly, so was not working. This will be fixed in next Orion release 🙂

    If you need, we can share a Dev build with you where you can test updated support for ImageData

      dino How long time is required for the official update of beta version? If it is long, I can test the Dev build too. I want to use Violentmonkey in Orion without any issue.

      • Vlad replied to this.
        No one is typing