TargetAlert for Firefox

www.bolinfest.com

Tips & Tricks

Customize the style of appended alerts by defining the targetalert class in userContent.css.
Images for appended alerts have the following two attributes:
  style="display: inline !important; margin-left: 5px; margin-bottom: -3px; border: 0px none;"
  class="targetalert"
Because the class is targetalert, you can override the default style for the image by editing your userContent.css file. If you have not worked with userContent.css before, then you probably need to create this file. To learn how and where to create this file, see the instructions for creating userContent.css for Firefox or Mozilla on mozilla.org. Alternatively, you can install the chromEdit extension (which works with both Firefox and Mozilla) that lets you edit userContent.css and other profile-related files without the hassle of figuring out where they are stored on disk.

Once you have created userContent.css, you can define whatever CSS you like for appended alert images. The following CSS could be used to ensure that alerts display with a white background:

img.targetalert {
  background-color: #ffffff !important;
}
Because TargetAlert icons have transparent backgrounds, their background color will be that of the current web page; however, the above customization will guarantee that the background of the image will always be white. This can be helpful on web pages whose background color makes the alert difficult to see.

Another option is to add a thin border around the image so that it is more visible while still using the page's natural background color. This can be achieved by using the following customization:

img.targetalert {
  border: 1px solid #ffffff !important;
}

On MS Windows, use the moz-icon: protocol to get the icon associated with a file extension.
When defining your own alerts for a particular file extension, you may want to use the same icon that Windows already uses when displaying that file in Windows applications such as Explorer. Both Firefox and Mozilla make it possible to access this icon (on Windows only) through the moz-icon: protocol. For example, typing the following into the address bar will display the icon that Windows displays next to a file whose name ends in .pdf:

moz-icon://.pdf?size=16
To get the default icon for other filetypes, substitute pdf with the desired file extension. To change the size of the icon, change the value of the size parameter. Although any number could be entered, I believe that 16 and 32 are the only valid values; if a different value is entered, then 16 or 32 is used, whichever is more appropriate. As I have yet to find any documentation for the moz-icon: protocol on mozilla.org, the information I have here is only the results of my own experimentation with the protocol and should not be treated as official documentation.


©2004 Michael Bolin » bolinfest@gmail.com www.bolinfest.com