Web Standards
  Home arrow Web Standards arrow Configuring Firefox for Chrome and a Serve...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WEB STANDARDS

Configuring Firefox for Chrome and a Server
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2008-06-05

    Table of Contents:
  • Configuring Firefox for Chrome and a Server
  • Running as a Local Installation
  • Package Registration
  • Configuring the Server

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Configuring Firefox for Chrome and a Server


    (Page 1 of 4 )

    If you have been building Internet applications with XUL, you'll appreciate this four-part article series. It explains how to prepare such an application for a commercial setting. This article is excerpted from chapter four of Programming Firefox, written by Kenneth C. Feldt (O'Reilly, 2007; ISBN: 0596102437). Copyright © 2007 O'Reilly Media, Inc. All rights reserved. Used with permission from the publisher. Available from booksellers or direct from O'Reilly Media.

    In this chapter, we will move our application from its home in a test directory to a setting that is more consistent with commercial implementations.

    We will create two key pieces for implementing our application:

    1. A local XUL application communicating with a Personal Hypertext Processor (PHP) server
    2. A remote XUL application being served by PHP scripts

    Both implementations will use an SQL database to hold user and password information to conduct the authentication process. Figure 4-1 shows a block diagram illustrating the relationship of the main elements of our design.


    Figure 4-1.  NewsSearch information flow

    Chrome Overview

    This book uses the term XUL application to describe our NewsSearch project. This differs from conventional web applications that are designed to be served web pages that are rendered by web browsers. A XUL application, however, can be implemented as a page served to a XUL-capable browser, or it can be configured to run as an application local to the user’s machine. In the case of the latter, the files that comprise the application (JavaScript source, stylesheets, datafiles) are installed in a chrome directory and run as a chrome URL.

    To date, the most popular XUL applications, such as the Firefox browser, Thunderbird mailer, and Sunbird calendar, are implemented as bundled applications running from the user’s chrome directory.

    Web developers refer to traditional web applications as being subject to the rules of a security sandbox. Originating from the Java language’s security policy, the sandbox philosophy limits the reach of executable code to a certain area. For browsers, this means that unprivileged JavaScript can access data from a served document and from documents sharing its URL, but the browser infrastructure allows no access to the local filesystem or to potentially destructive operating system and network services.

    There are cases when the local browser needs to store information on a user’s computer. This information may include bookmarks, runtime preferences, or other saved settings that would impair the user experience if not kept locally accessible; the sandbox is therefore expanded to include a controlled portion of the local filesystem. Applications that are registered within Firefox’s chrome are granted an area on the local disk to which full read/write access is granted.

    In addition to meeting the security requirements imposed by the Firefox framework, a chrome application has a different look to it.

    Before launching our code as a chrome application, we should change the testStyles.css stylesheet to provide a default background color for our window:

      window {
      
    background-color:white
    ;
      }

    (The default window color is needed when launching a chrome application from the command line.)

    To see what our test application would look like as a chrome application, open a command window and launch Firefox from the command line, specifying the
    –chrome option along with the pathname to the source file. The –chrome option directs the framework to display the source as a chrome window, not as a browser window.

    On an OS X machine, the code would look like this:

      theUser% pwd 
      theUser% /Applications/Firefox.app/ Contents/MacOS
      theUser% ./firefox -chrome "file:Macintosh HD:tests:theWindowWithLogin.xul"

    Our NewsSearch application now appears as a chrome window with none of the controls we associate with a browser (see Figure4-2 ).

    Simply launching an application with the–chromeoption and a file URL will give us a chrome appearance, but to run it as a client/server chrome application, we will need to install the application as a chrome package, or serve the interface as a XUL page.


    Figure 4-2.  Application launched as a chrome window

    More Web Standards Articles
    More By O'Reilly Media


       · This article is an excerpt from the book "Programming Firefox," published by...
     

    Buy this book now. This article is excerpted from chapter four of Programming Firefox, written by Kenneth C. Feldt (O'Reilly, 2007; ISBN: 0596102437). Check it out today at your favorite bookstore. Buy this book now.

    WEB STANDARDS ARTICLES

    - Completing a Configuration for Chrome and a ...
    - Getting Connected with Firefox and Chrome
    - Configuring Servers and Databases with Chrome
    - Configuring Firefox for Chrome and a Server
    - Designing the Elements of a Web Page
    - Matching div heights with CSS and JavaScript
    - Forms
    - Get Down With Markup
    - If I Said You Had a Beautiful Body...
    - Web Standards in Dreamweaver Part 3
    - Web Standards in Dreamweaver, Part 2
    - Web Forms
    - Making Lists Using XHTML
    - Web Standards in Dreamweaver, Part 1






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT