Difference between revisions of "Make FUEL work with Firefox 2"

From CDOT Wiki
Jump to: navigation, search
(Project Details)
(fuelApplication.js)
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== Introduction ==
 
== Introduction ==
Under Construction
+
FUEL (Firefox User Extension Library) is a JavaScript Library designed to help developers build extensions using terminology and interfaces that are familiar to them. It will be usable in Firefox 1.5-3.0.
 +
FUEL is about making it easier for extension developers to be productive, by minimizing some of the XPCOM formality and adding some "modern" JavaScript ideas. We want to start with areas that will provide the most benefit.
 +
[http://wiki.mozilla.org/FUEL source]
  
 
== The People ==
 
== The People ==
Line 6: Line 8:
 
* [[User:Samer.Ziadeh|Samer Ziadeh]]
 
* [[User:Samer.Ziadeh|Samer Ziadeh]]
  
== Project Leader(s) ==
+
== TODO ==
 +
* At the moment FUEL is manually added to the build (see below). It will be much easier if the build script did it for us :)
  
Name(s) of primary people working on the project. If you want to join a project as leader, discuss with other leaders first. Include links to personal pages within wiki
+
== Project Details ==
 +
At the moment FUEL only works on Firefox3. This project is dedicated in back porting FUEL to make it work with Firefox2
 +
 
 +
== fuelApplication.js ==
 +
'''fuelApplication.js''' is located in '''mozilla/browser/fuel/src''' and will be the main file that will undergo the changes.
 +
You can get the latest update of it [http://www.samerziadeh.com/mozilla/fuelApplication.js here]. It's just a plain text file, it doesn't have the fancy change revision.
 +
 
 +
Below are the list of the functions I tested with and what did and didn't work.
 +
 
 +
<b><font style="font-size:120%">Working:</font></b>
 +
* Console
 +
<b><font style="font-size:120%">Not Working:</font></b>
 +
* Bookmarks
  
== Project Contributor(s) ==
+
== Build Instructions ==
 +
We need to create a directory to throw the mozilla source in.
 +
<pre>mkdir mozilla-1.8-branch
 +
cd mozilla-1.8-branch</pre>
  
Name(s) of people casually working on the project, or who have contributed significant help. Include links to personal pages within wiki
+
This will fetch the ''client.mk'' file from mozilla.
 +
''client.mk'' contains info on how to configure the build tree to configure any product
 +
the ''-r MOZILLA_1_8_BRANCH'' specifies to the server that we want the ''client.mk'' file from the 1.8 branch
 +
<pre>cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -r MOZILLA_1_8_BRANCH mozilla/client.mk</pre>
  
NOTE: only Project Leader(s) should add names here.  You '''can’t''' add your own name to the Contributor list.
 
  
== Project Details ==
+
Now we need to create the ''.mozconfig'' file.
 +
It contains parameters for ''client.mk'' on how to checkout and build.
 +
The last ''ac_add_options'' line is not needed for non Mac machines.
 +
<pre>cd mozilla
 +
cat > .mozconfig << MOZCONFIG
 +
# Options for client.mk.
 +
mk_add_options MOZ_CO_PROJECT=browser
 +
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir
 +
mk_add_options MOZ_MAKE_FLAGS="-s -j4"
 +
 
 +
# Options for 'configure' (same as command-line options).
 +
ac_add_options --enable-application=browser
 +
ac_add_options --enable-debug
 +
ac_add_options --enable-tests
 +
ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.4u.sdk
 +
MOZCONFIG</pre>
 +
 
 +
After creating the MozConfig file we can begin downloading the source. <small>(around 220mb)</small>
 +
<pre>make -f client.mk checkout</pre>
 +
 
 +
Now we can start building firefox.
 +
<pre>make -f client.mk build</pre>
 +
When finished the firefox executable is found in the following directories
 +
* xp/*nix: mozilla/dist/bin/firefox
 +
* mac: mozilla/dist/bin/Something.app/Contents/MacOs/firefox
 +
 
 +
To download FUEL navigate to ''../mozilla''
 +
<pre>cd ..
 +
cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/browser/fuel</pre>
 +
 
 +
Now that we have acquired the fuel source we need to modify the ''browser/Makefile.in'' to let the build know about the addition
 +
<pre>cd mozilla/browser
 +
vi Makefile.in</pre>
 +
* Go to the line starting with DIRS
 +
* Append fuel to the end of it
 +
<pre>DIRS = base components locales extensions themes app fuel</pre>
 +
 
 +
The build script doesn't generate the fuel part automatically, which is why fuel is fetched after the build is done.
 +
The following steps will force the generation of the makefiles manually, and then rebuild fuel and app
 +
<pre>cd ../objdir
 +
../build/autoconf/make-makefiles browser/fuel
 +
make -C browser/fuel
 +
make -C browser/app</pre>
  
Soon soon :)
+
and there you have it, FUEL is now built into ff2
  
== Project News ==
+
== Links ==
  
[http://samermozilla.blogspot.com/ Samer's Blog]
+
* [http://samermozilla.blogspot.com/ Samer's Blog]
 +
* [http://quality.mozilla.org/en/node/452 How To Build a Mozilla Tree]
 +
* [http://wiki.mozilla.org/FUEL FUEL]
 +
* [http://developer.mozilla.org/en/docs/FUEL FUEL docs]
 +
* [https://bugzilla.mozilla.org/show_bug.cgi?id=390335 bug #390335]
 +
* [http://mxr.mozilla.org/seamonkey/find?string=fuel%2Ftest%2Fbrowser_&tree=seamonkey FUEL JS Test Files]

Latest revision as of 21:43, 23 March 2008

Introduction

FUEL (Firefox User Extension Library) is a JavaScript Library designed to help developers build extensions using terminology and interfaces that are familiar to them. It will be usable in Firefox 1.5-3.0. FUEL is about making it easier for extension developers to be productive, by minimizing some of the XPCOM formality and adding some "modern" JavaScript ideas. We want to start with areas that will provide the most benefit. source

The People

TODO

  • At the moment FUEL is manually added to the build (see below). It will be much easier if the build script did it for us :)

Project Details

At the moment FUEL only works on Firefox3. This project is dedicated in back porting FUEL to make it work with Firefox2

fuelApplication.js

fuelApplication.js is located in mozilla/browser/fuel/src and will be the main file that will undergo the changes. You can get the latest update of it here. It's just a plain text file, it doesn't have the fancy change revision.

Below are the list of the functions I tested with and what did and didn't work.

Working:

  • Console

Not Working:

  • Bookmarks

Build Instructions

We need to create a directory to throw the mozilla source in.

mkdir mozilla-1.8-branch
cd mozilla-1.8-branch

This will fetch the client.mk file from mozilla. client.mk contains info on how to configure the build tree to configure any product the -r MOZILLA_1_8_BRANCH specifies to the server that we want the client.mk file from the 1.8 branch

cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -r MOZILLA_1_8_BRANCH mozilla/client.mk


Now we need to create the .mozconfig file. It contains parameters for client.mk on how to checkout and build. The last ac_add_options line is not needed for non Mac machines.

cd mozilla
cat > .mozconfig << MOZCONFIG
# Options for client.mk.
mk_add_options MOZ_CO_PROJECT=browser
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir
mk_add_options MOZ_MAKE_FLAGS="-s -j4"

# Options for 'configure' (same as command-line options).
ac_add_options --enable-application=browser
ac_add_options --enable-debug
ac_add_options --enable-tests
ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.4u.sdk
MOZCONFIG

After creating the MozConfig file we can begin downloading the source. (around 220mb)

make -f client.mk checkout

Now we can start building firefox.

make -f client.mk build

When finished the firefox executable is found in the following directories

  • xp/*nix: mozilla/dist/bin/firefox
  • mac: mozilla/dist/bin/Something.app/Contents/MacOs/firefox

To download FUEL navigate to ../mozilla

cd ..
cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/browser/fuel

Now that we have acquired the fuel source we need to modify the browser/Makefile.in to let the build know about the addition

cd mozilla/browser
vi Makefile.in
  • Go to the line starting with DIRS
  • Append fuel to the end of it
DIRS = base components locales extensions themes app fuel

The build script doesn't generate the fuel part automatically, which is why fuel is fetched after the build is done. The following steps will force the generation of the makefiles manually, and then rebuild fuel and app

cd ../objdir
../build/autoconf/make-makefiles browser/fuel
make -C browser/fuel
make -C browser/app

and there you have it, FUEL is now built into ff2

Links