'Safari Extension Icon Become Very Small in macOS 12.3

The icon size was fine on previous version of macOS. After installed macOS 12.3, the icon became very small. The icon I used was 34x34 in pixel. I tried to use large icon, size 256x256 in pixel. However, the icon was still small. My code:

override func validateToolbarItem(in window: SFSafariWindow, validationHandler: @escaping ((Bool, String) -> Void)) {
    // This is called when Safari's state changed in some way that would require the extension's toolbar item to be validated again.

    window.getToolbarItem { (toolbarItem) in
        toolbarItem?.setImage(NSImage(named: "MonochromeIcon"))
        toolbarItem?.setLabel(NSLocalizedString("Open URL in Page By Poster 2", comment: ""))
    }
    
    validationHandler(true, "")
}

Any idea?



Solution 1:[1]

It turned out that it was the issue of Safari itself. I tried to used another icon and everything was fine. So only the icon I used can't be used.

For workaround, I had to change the icon. I will file a bug report to Apple and let them to investigate.

----Update-----

To use my original icon, I reimplemented the macOS Safari extension. Currently, macOS Safari extension could be implemented the same as iOS extension. And in that way, the icon will work.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1