Skip to content

Happy-Ferret/gecko

 
 

Repository files navigation

Welcome To Chromeless!

The 'chromeless' project is an experiment into making it possible to build a web browser using only web technologies, like HTML, JavaScript, and CSS.

The project is based on addon-sdk (aka, "jetpack"), and xulrunner.

Current State

This project is highly experimental, rapidly changing, and probably insecure. As the project matures, this notice will change.

Design Overview

Chromeless can be used to created desktop applications using HTML, and related web technologies. In version 0.1, the original goal was a focus towards authoring a browser-like applications in HTML. That is still valid, however, now you can also use Chromeless to create all sorts of apps that can be executed like a native application, but where all of the look and feel, and many of the behaviors are defined by HTML, CSS, and javascript provided by the developer.

This "main app HTML" is basically a normal webpage, but with several important differences:

  • The HTML file has access to a 'window.require()' function that it can use to access new APIs that give it increased priviledges.

  • (untrusted) Web content can be rendered inside iframes which are children of the top level "main app HTML". This content cannot tell its rendered inside an iframe, and has no special access to the main app context.

  • Several new events and conventions are introduced. For instance, the title of the top level browser HTML is the name of the running process (not yet implemented), new, non-standard events are available to the top level browser HTML which give it a priviledged view (and control) over embedded web content.

Prerequisites

  • OSX 10.5 and later, Windows XP and later, or probably a modern versions of linux (32 or 64 bit).
  • NodeJS 0.10.x or higher.
  • Building NodeJS dependences
npm up

Getting Started

The top level chromeless NodeJS script is capable of several things:

  • running an app when provided a path to 'app HTML'
  • packaging aan app as a xulrunner package, or a standalone exectuable (not yet implemented)
  • running unit tests (not yet implemented)
  • generating static documentation for all current APIs (not yet implemented)

To get started, you should clone this repository (or download a versioned snapshot) and run:

(win32) C:\xxx\chromeless> chromeless -r
(osx)   $ ./chromeless -r

By default, the HTML files in examples/api-demo will be executed, and you'll see a very simple browser based on them. You may also specify an alternate app HTML on the command line:

(win32) C:\xxx\chromeless> chromeless -r examples\webgl
(osx)   $ ./chromeless -r examples/webgl

From here, you can inspect the implementation of any of these samples, copy, modify and explore.

For deployment or to share your application, you can use chromeless to generate a standalone application folder, that anyone on a supported platform can run. Output will be placed in the build/ directory:

(win32) C:\xxx\chromeless> chromeless examples\webgl
(osx)   $ ./chromeless examples/webgl

Finally, it's possible to generate a "XULRunner application", which is a folder that is much smaller than a standalone application, but can be run under (a specific version of) xulrunner. Again, the output will be placed in the build/ directory:

(win32) C:\xxx\chromeless> chromeless -p examples\webgl
(osx)   $ ./chromeless -p examples/webgl

For more commandline options, please run the following command for more information:

(win32) C:\xxx\chromeless> chromeless -h
(osx)   $ ./chromeless -h

Documentation and Additional Information

To generate a local API documentation, use:

(win32) C:\xxx\chromeless> chromeless docs
(osx)   $ ./chromeless docs

You can always find us on irc in #labs at irc.mozilla.org, or get help or discuss this project on our mailing list: mozilla-labs@googlegroups.com

Sub-projects for Tests

A Tests application is provided along wth Chromeless and can execute tests for all the apps under tests/ directory that have the test-app.js file in it:

(win32) C:\xxx\chromeless> chromeless tests
(osx)   $ ./chromeless tests

Notes and Known Issues

  • You need to pass a relative path to your application when you invoke chromeless script
  • This version only packages your files that are under your main application directory. So if you use, for example, jquery in a sub-directory, it will not be bundled. Make sure you have all your files in the same directory.
  • With Mac OSX, if you launch the application for tests ( not passing package option ), the keyboard output will show in the console and not in the browser screen. For Mac OSX, you may need to use the "package" argument and install in your machine.
  • It works with some specific versions of XULRunner. And to help out developers, the chromeless script will fetch a XULRunner SDK.

LICENSE

All files that are part of this project are covered by the following license, except where explicitly noted.

Version: MPL 1.1/GPL 2.0/LGPL 2.1

The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/

Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.

The Original Code is chromeless.

The Initial Developer of the Original Code is the Mozilla Foundation.

Portions created by the Initial Developer are Copyright (C) 2010
the Initial Developer. All Rights Reserved.

Contributor(s):

Alternatively, the contents of this file may be used under the terms of
either the GNU General Public License Version 2 or later (the "GPL"), or
the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
in which case the provisions of the GPL or the LGPL are applicable instead
of those above. If you wish to allow use of your version of this file only
under the terms of either the GPL or the LGPL, and not to allow others to
use your version of this file under the terms of the MPL, indicate your
decision by deleting the provisions above and replace them with the notice
and other provisions required by the GPL or the LGPL. If you do not delete
the provisions above, a recipient may use your version of this file under
the terms of any one of the MPL, the GPL or the LGPL.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 85.5%
  • HTML 7.4%
  • Java 7.1%