js), xpcshell lets the scripts running in it access XPCOM functionality.
You need your own build of Mozilla to use xpcshell.
xpcshell is almost always in the same directory as run-mozilla.sh.
$ locate run-mozilla.sh /usr/lib/firefox-0.10.1/run-mozilla.sh /usr/lib/thunderbird-0.9/run-mozilla.sh /usr/local/mozilla/run-mozilla.sh /opt/mozilla/run-mozilla.sh /root/.Trash/mozilla/run-mozilla.sh
Just pick one, cd over there, and run-mozilla.sh xpcshell, if it's present. (However, it might not be there if you have a non-debug version of Firefox, Mozilla, Thunderbird, etc.)
$ cd /opt/mozilla $ ./run-mozilla.sh ./xpcshell js>
Execute XPCShell from Window
The built xpcshell.exe can't be executed under the mozilla build shell(bash). It should be executed under the window command prompt
js> 5+7 12 js> print("Hello, world!") Hello, world! js>
- HOWTO for common problems in writing xpcshell scripts, e.g., doing async network calls or using JS modules.
- Pretty much all Mozilla programs use XPCOM components via XPConnect.
- Read XPConnect:Using components to get started with that.
- See the XPCShell Reference for information on command line arguments and extension functions.
- Learn how to write xpcshell-based unit tests.
- Read XPCShell:Profiling for information on how to profile scripts.