Image of Android Wireless Application Development
Image of RHCE Red Hat Certified Engineer Linux Study Guide (Exam RH302) (Certification Press)
Image of XSLT 2.0 and XPath 2.0 Programmer's Reference (Programmer to Programmer)
Image of Advanced Programming in the UNIX Environment, Second Edition (Addison-Wesley Professional Computing Series)

Using JavaScript Code Modules in Firefox 4 Add-Ons

The concept of a JavaScript code module in the Gecko layout engine was first introduced in Gecko 1.9. This post discusses how such code modules can be used to simplify preference and add-on management in Firefox 4 which uses Gecko 2.0 and JavaScript 1.8.5. It uses a simple Firefox add-on called HTML5toggle as an example of how to modify existing code to use Javascript code modules. A JavaScript code module is simply some JavaScript code located in a registered (well-known) location. JavaScript code modules are primarily used to share code between different privileged scopes. They can also be used to

V8 JavaScript Engine on Fedora 14

The recent announcement by Google of a new compilation infrastructure, aptly codenamed CrankShaft, for their V8 JavaScript engine prompted me to revisit this particular JavaScript engine and to compile and install it on a Fedora 14 X64 platform. Crankshaft is the latest iteration of the V8 JavaScript (V8) engine and is somewhat similar to Mozilla’s TraceMonkey JavaScript engine in that it attempts to aggressively optimize code that is regularly executed but avoid much optimization of code that is infrequently executed. Currently the Mozilla Spidermonkey JavaScript shell is available as a standard RPM package for Fedora 14. In a previous post

Updating the Fedora 14 JavaScript Shell

For those who are not familiar with a JavaScript shell, it is a command line interface to a JavaScript engine. Similar to Python or Ruby, the JavaScript shell has two modes of operation. You can use it as an interactive shell, in which you type JavaScript code at a prompt and get instant results, or you can invoke a JavaScript program. The easiest way that I know of to build a JavaScript shell on Fedora is to download and build either the SpiderMonkey or TraceMonkey JavaScript engine, both of which come with a JavaScript Shell. TraceMonkey recently replaced SpiderMonkey in

JavaScript Shells

Recently I was working on a fairly complex JavaScript script relating to floating point conversions for a new Web page.  After a while I got tired on trying to debug the problem via a Web browser and decided to see if I could find a JavaScript shell, i.e. a standalone Javascript intrepreter just like Ruby’s irb, Python’s interactive prompt or the Korn shell, which could load and run JavaScript scripts from the command line without having to reload a Web page. First, some background on the JavaScript langauge for those who are unfamilar with the details.  JavaScript is a complex full-featured weakly