Create a simple Firefox add -on using Ubiquity
At the beginning
In 2004, at the request of a game software maker, I was in charge of a job to fix the XML -based workflow used in the company's business.The content of the request was that the writer who attended the SF and the game conference could write a report on his laptop even in an environment that is not connected to the Internet.At that time, Firefox had begun to spread explosively, so I looked into this browser XUL interface in a fairly detailed way to understand it.
At the end of the work, I managed to create a fairly advanced editor, and in the process I was able to understand the Firefox mechanism to a considerable degree.It was also found that the combination of XHTML and JavaScript and CSS was as powerful as XUL, more flexible than XUL, and more support in many applications than XUL.
Furthermore, it was not so difficult to create Firefox add -ons. That said, development takes a lot of time. This is because there is no official development IDE for add -on creation (Venkman is the closest, but not it). Therefore, when creating a component, it is necessary to build XUL support and overlay, bind with JavaScript and CSS (and any XBL required for support), and update one or more configuration files. (The configuration file will change each time the version changes). Then, compress the contents to the zip file, read the new add -on, restart the browser, and wait for a mistake to crash the browser.
In the case of a large application, there is still the advantage of creating an add -on, but if it is simple, bind and zip, and create an expansion of the "glance" that does not require the troublesome procedure of updating.Is good.It is easier if the add -on you want to create is just like a system shell script that executes the basic task of the system.
That's why the Mozilla R & D team wanted to create UBIQUITY.This is an add -on that allows you to use a browser command line.For example, I always write a fairly long article, but since my content creation has recently moved to the web, I don't know how many words I wrote in a paragraph.there is.
If you use Ubiquity, you can select a text and press the Ctrl + Space key (key is changed) to launch the command line "shell" and enter "Word-Count" at the prompt.This displays a fairly accurate number of words within the selection directly below the prompt.When you press the return key, the command line disappears and the number of words is displayed in the lower right corner of the screen as a pop -up message.
Various UBIQUITY commands are written in JavaScript and are stored inside as local resources.In addition to a series of JavaScript functions that can be usually used from browsers, Ubiquity also supports many additional functions that make pages and easily.There is also a hook that catches events such as mouse clicks, keepers, page roads and unloading.In this regard, Ubiquity is very similar to Greasemonkey.However, GREASEMONKEY runs the script on the document when loading.On the other hand, the Ubiquity script has the advantage of being able to use it at any time, not just when loading.