1.2.0 • Published 8 years ago

capella v1.2.0

Weekly downloads
1
License
MIT
Repository
-
Last release
8 years ago

Capella: a cross-browser extension framework

Capella is a work in progress!

capella logo

Capella is a cross-browser extension framework. Up to now it supports chrome, opera and firefox.

How it works:

If you deal with cross-browser extension development, you have to address two main issues:

  • Every browser has its own API
  • Every browser has its own mechanism to import/include files to your extension

So this is how Capella deals with the issues:

  • Capella has a cross-browser API that hides the different browser APIs.
  • All browsers have a thing in common: they have a persistent background script and contents script which run in the web pages. Capella has a preprocessor which is able to include files (.html or .js) to scripts. So you can include jquery by writing INCLUDE(jquery.min.js) in your content script, and that will copy the content of jquery.min.js to your content script. By using the import mechanism you can use every library you want!

How to install Capella:

  1. Install node.js with npm
  2. Install google chrome if you want to develop chrome extensions
  3. Open command shell
  4. Run npm install -g jpm to install build tool for firefox addons
  5. Run npm install -g capella to install capella

Capella project structure:

my-extension/
    +-- manifest.json
    +-- data/
        +-- js/
        +-- css/
        +-- html/
        +-- ...
    +-- build/
        +-- my-extension-chrome/
        +-- my-extension-firefox/

In your main directory, there is the chrome-style manifest descriping your extension and the data folder containing all resources. Run capella build in your main directory to build your extension. The build output is copied to the build directory.

Capella commands:

  • capella init: create an (nearly) empty but valid example extension
  • capella build {target}: run this command in the main directory (where manifest.json is situated). Creates extension for target browser (chrome or firefox) or both if target is not specified. The output is saved to directory build

Preprocessor commands:

  • INCLUDE(myscript.js): Replaces the include command with the content of the specified files
  • INCLUDE_AS_STRING(myfile.html): Includes the content of the file as a string. Example: var popup = INCLUDE_AS_STRING(mypopup.html);

Capella API:

To use the Capella API you have to insert INCLUDE(capella.js) to your file javascript file.

TODO: add API reference

1.2.0

8 years ago

1.1.8

8 years ago

1.1.7

8 years ago

1.1.6

8 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago