In the toolbar, "The browser action icons in Chrome are 16 dips (device-independent pixels) wide and high." This is also the same as in Safari on Mojave. This is the same as in Safari Extensions Preferences, except for the retina difference. According to Google's documentation, "Extensions should also provide a 48x48 icon, which is used in the extensions management page". Safari Mac extension icons are similar to but not exactly the same as Chrome extension icons. I haven't seen any usage of the 128, 256, or 512 sizes, though. This is mostly in line with the developer documentation, which recommends providing 16-, 19-, 32-, and 38-pixel sizes for the toolbar and 48-, 64-, 96-, 128-, 256-, and 512-pixel sizes for Safari Preferences. I believe that these sizes are determined by Safari's toolbarItemIdealPointSize private method. On macOS Big Sur, the toolbar shows the 38x38 retina and 19x19 non-retina icon sizes, while on macOS Mojave, the toolbar shows the 32x32 retina and 16x16 non-retina icon sizes. The toolbar of a Safari window, in contrast, uses the default_icon list of the browser_action in the manifest. The Websites pane shows the 64圆4 icon on both retina and non-retina. In the Preferences window of Safari Mac, the Extensions pane uses the icons list from the manifest, showing the 96x96 icon on retina screens and the 48x48 icon on non-retina screens. Then I added all of the icons to my Safari extension's manifest.json file to see which icons Safari would pick when given the choice. In order to distinguish them visually, each icon was a numerical representation of the icon's size. As an experiment, I programmatically generated a bunch of extension icons of every conceivable size. Wait, I just remembered that I'm irrational! Of course I'm going to reverse engineer the thing. Thank you for reading my blog post, and sorry for wasting your time. And without proper documentation, the only rational option is to give up. Also, please provide a sample project, or sysdiagnose captured immediately after the issue occurs along with a relevant timestamp for closer examination." For documentation feedback! So that was less than helpful. I filed a Feedback (FB9207164) requesting that Apple update the documentation, but Apple inexplicably requested that I "Please capture a screen recording of the issue reproducing. Ironically, the Safari toolbar itself gets color in macOS Monterey, but not the toolbar items.Īpple's developer documentation for Safari web extensions has a section about icons, but it appears not to have been updated for Safari extensions on iOS. If you're porting your Chrome extension to Safari Mac, you may notice that your toolbar item suddenly seems out of place and conspicuous it's almost like landing in Kansas after having been to the land of Oz. Safari unfortunately tends to eschew the use of color now: you can see that all of Safari's built-in toolbar items are grayscale. (There's an older Mac-specific Safari app extension format, but that won't be available on iOS.) One easily noticeable platform-specific difference is the extension icons. I'm working on bringing my Safari extensions StopTheMadness and Tweaks for Twitter from Mac to iOS, and it's progressing well! During this process I've noticed that there are some platform-specific differences between Safari iOS and Safari Mac extensions, as indeed there are between Safari Mac extensions and Google Chrome extensions, even though they all use the same cross-platform Web Extension format. Safari extension icons Articles index Safari extension development: icons Jby Jeff Johnson
0 Comments
Leave a Reply. |