The actual image to display will be selected from the set to best fit the pixel size of 16 dip. To properly display icon when screen pixel density (ratio size_in_pixel / size_in_dip) is different than 1, the icon can be defined as set of images with different sizes. To set the icon, use the default_icon field of browser_action in the manifest, or call the tIcon method. For unpacked extensions, images must be in the PNG format. Static images can be in any format WebKit can display, including BMP, GIF, ICO, JPEG, or PNG. Using static images is easier for simple applications, but you can create more dynamic UIs-such as smooth animation-using the canvas element. You can set the icon in two ways: using a static image or using the HTML5 canvas element. Larger icons are resized to fit, but for best results, use a 16-dip square icon. The browser action icons in Chrome are 16 dips (device-independent pixels) wide and high. Register your browser action in the extension manifest like this: Ī browser action can have an icon, a tooltip, a badge, and a popup. If you want to create an icon that isn't always active, use a page action instead of a browser action. In the following figure, the multicolored square to the right of the address bar is the icon for a browser action.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |