|
||
| Inside Technique : Extending the Browser : Introduction and Security By default, your extension has no user interface. Instead, the HTML page that contains your extension is opened and executed inside of a hidden browser window. This allows you to write extensions that operate directly on the document without interrupting the user. Alternatively, the web-page containing the extension can be opened in a modal dialog. Modal dialogs require the user to respond before they can continue to browse. In no circumstances can the web-page be opened inside of a standard browser window. Instead, when a standard browser window is desired, your script must manually open a new window and write the contents of the page with the document open and write methods. This distinction occurs because of the special security priveleges granted to your extension. Security and Browser Menu ExtensionsBrowser extensions have special security priveleges allowing them full access to the HTML document. These priveleges only exist for the web page containing the extension and only during the extensions execution. All extensions also run synchronously inside of the browser which means the extension must finish executing before the user can continue with the browser. Therefore, there is no way to write an extension that automatically polls the browser. This security model also explains why an extension only runs without a user interface or within a modal dialog. This ensures a single path through the page and that the user is returned to the browser. When using the document object model in an extension to open new windows, these new windows have the traditional cross-frame security model and do not have access to the original browsing window. Therefore, when an extension is finished running, there is no way for any of the output to work-around the cross-frame domain security. You are now ready to create your first extension. Your first extension takes you through the steps from writing the script to registering the file. You will learn the basics for how extensions work. Following this extension, we take you through a more complete (and useful) extension that helps you annotate web pages. Page 1:Extending the Browser © 1997-2000 InsideDHTML.com, LLC. All rights reserved. |