Skip to content
This repository has been archived by the owner on Feb 5, 2022. It is now read-only.

rhelmer/AddonManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AddonManager

This is a replacement for the Firefox AddonManager, written in Rust.

Add-ons are components that can be hot-loaded into Firefox, such as:

  • WebExtensions
  • Native Firefox Extensions
  • Themes
  • Services

AddonManager is responsible for:

  • parsing manifests
  • installing add-ons (download, verify, stage, install)

The API is easy to use:

use addonmanager::{Manifest, InstallLocation, Addon, Install}

fn main() {
  // This could come from a remote server or a local file.
  let manifest = Manifest::new(...);

  // The place to install add-ons.
  let install_name = InstallLocationName::Profile;
  let base_directory = String::from("c:\\Extensions");
  let install_location = InstallLocation::new(install_name, base_directory); 

  // Represents the addon itself.
  let addon = Addon::new(manifest, install_location);

  // The state machine that downloads, verifies, installs
  // the Addon to the InstallLocation.
  let mut install = Install::new(addon);
  
  // Start the install process.
  install.download();
}

Running

cargo run

NOTE - if you get an error about the OpenSSL header file being missing on Mac OS X with Homebrew, try:

export OPENSSL_INCLUDE_DIR=$(brew --prefix openssl)/include
export OPENSSL_LIB_DIR=$(brew --prefix openssl)/lib
cargo run

Testing

cargo test

About

AddonManager for Firefox written in Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages