I have vaguely mapped out what I believe how Ubiquity works and interacts with all the various pieces. I may make some updates to this once I determine more information from Jono:
Ubiquity System
————————
There are 2 types of commands:
Built-in commands
User-created/Third party commands
Built in commands are hardcoded in js files and are stored along with the extension
User created commands are stored on web servers remotely.
These user created commands along with their source code are stored in a database that resides on the local hard drive within the Firefox profile. Should the user wish to add new commands, he/she visits a page that links to a javascript file specifically with the rel attribute set to “commands”. i.e. <link rel=”commands” src=”my_js_file” /> Ubiquity will search the webpage for this tag and asks if the user would like to subscribe and if they do so, it will add a create a new entry into the database, storing the URI, and source code. The commands are id’ed by the URI and subscribed commands never get deleted until manually told to do so.
Ubiquity goes through all the annotations and checks all the URIs for the tag.. it then attempts to update the source code in the database if needed. Commands are then loaded into a Command Manager object and using a Factory, the commands are created from the source code.
Thus if you close the web browser and reload, the commands still exist because of the annotations to the URI and source code stored in the database.
In terms of security, no security has yet been implemented so command source code has access to all areas of the web browser. There have been talks regarding a trust system but those are at a preliminary stage.