ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Roll Your Own Browser
Subject:   Instructions to get this example up and running
Date:   2003-01-22 07:27:34
From:   brianking
Here are quick and dirty instructions to get the customised browser example from this article up and running:


1. Create the following directory structure below the chrome directory on your Mozilla installation:
mybrowser/content


2. Create the following file, name it 'contents.rdf', and put it in the new content directory:


<?xml version="1.0"?>


<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">


<!-- list all the packages being supplied -->
<RDF:Seq about="urn:mozilla:package:root">
<RDF:li resource="urn:mozilla:package:mybrowser"/>
</RDF:Seq>


<!-- package information -->
<RDF:Description about="urn:mozilla:package:mybrowser"
chrome:displayName="myBrowser"
chrome:author="frillies"
chrome:name="mybrowser">
</RDF:Description>


</RDF:RDF>


3. Add the XUL and JS file to the content folder too.
Please rename the files to mybrowser.xul/.js, as I don't want any clashes if you choose to install it on a Phoenix distribution.
When you do this, you will have to modify in the XUL file the path to the JS file from:
<script type="application/x-javascript" src="chrome://jslib/content/browser.js"/>
to
<script type="application/x-javascript" src="chrome://mybrowser/content/mybrowser.js"/>


4. Close Mozilla. In the chrome folder, add the following line to 'installed-chrome.txt'.
content,install,url,resource:/chrome/mybrowser/content/


5. Launch the example from the command line:
mozilla -chrome chrome://mybrowser/content


That should do it!