Showing posts with label firefox extension. Show all posts
Showing posts with label firefox extension. Show all posts

Monday, December 25, 2006

How to automatically install a button onto FireFox Toolbar?

Here are some facts about rdf:local-store in Mozilla architecture from XULPlanet:

  • The datasource rdf:local-store is included with Mozilla and is used to hold state information such as the position of the browser window, which columns in tree views are displayed, and which toolbars and sidebars are displayed.
  • This information is saved when Mozilla exits, and is re-applied automatically to the XUL content when the appropriate window is opened again.
  • Although the local store normally holds XUL state information, you can actually put anything you want into it.
  • The local store is saved to an RDF/XML file 'localstore.rdf' in your Mozilla profile directory. Since it's an RDF/XML file, you can open it in a text editor and view the information it contains. It's possible to modify the file as well, although that isn't
So the answer to our question on how to add a button to the browser's toolbar lies in the localstore.rdf file. Open the file and find the triple, or assertion, on chrome://browser/content/browser.xul#nav-bar and you should be able to see something like this:
RDF:Description
RDF:about="chrome://browser/content/browser.xul#nav-bar"
mode="icons"
currentset="back-button,forward-button,reload-button,search-container"

Just add your toolbar 'ID' to the currentset and you're done.

Wednesday, December 20, 2006

Setup FireFox Extension Development Environment

I've found that these links are very helpful:

Due to the nature of its graphical user interface, windows shell has been ignored for a long time. It's true that having a point-and-click interface doesn't require learning and remembering, but to boost your productivity, master the art of command line is a must. Be sure to install the cygwin environment and expose its bin folder into your %PATH% variable will bring tons of powerful Unix tools into your windows arsenal with almost no cost.

One thing I really love about the shell is its capability to jump right into your destination folder. For example, if you're developing your FireFox extension, following tips might be quite handy to you.

1. Jump into folders

set FIREFOX_INSTALL_DIR = "C:\Program Files\Mozilla Firefox"
set FIREFOX_DEV_PROFILE = "C:\Documents and Settings\adong\Application Data\Mozilla\Firefox\Profiles\k5b2sa
58.Dev"
// Now you could jump right into it by typing:
cd %FIREFOX_INSTALL_DIR%
cd %FIREFOX_DEV_PROFILE%
2. Start the FireFox in a 'dev' mode by
// instead of "C:\Program Files\Mozilla Firefox\firefox.exe" -P dev
set MOZ_NO_REMOTE=1
%FIREFOX_INSTALL_DIR%\firefox.exe -P dev
3. Or, find the merge point id for the "stausbar"
$ grep -r -n "statusbar .* id=" %firefox_install_dir% | grep ".\.xul:"