Skip to content
Vyacheslav edited this page Apr 17, 2016 · 2 revisions

Aria2 Google Chrome extension

This project aims to be a better way to manage your Aria2 instance. Aria2 is a lightweight multi-protocol & multi-source command-line download utility, which can be run as a daemon. This extensions uses Aria2 RPC.

Project structure

Since this is a Google Chrome extension, it contains html pages, scripts and other resources (like css files, images, fonts). Main folder for all of the source is src directory. This folder can be targeted as an "unpacked extension" in Google Chrome.

Google documentations for developing extensions can be found here.

Every page in this extension is an angular.js v1 application. Standalone scripts, however, do not use any parts of angular.

Parts of extension:

  • webui-aria2 folder contains submodule, which is a fork of hottest interface to interact with aria2. Fork in this folder is created especially to be compatible with extension.
  • libs folder contains external libraries used in this extension.
  • common folder contains internal libraries used in different parts of extension.
  • services folder contains libraries from common folder as angular.js services.
  • context_menu folder contains files used to add context menu items.
  • options folder contains page for managing project options.
  • popup folder contains browser action page.
  • manifest.json describes extension.

Development cycle

Cloning project

Clone project into your workspace and checkout submodule webui-aria2.

git clone https://github.com/SlNPacifist/aria2-chrome-extension/
cd ./aria2-chrome-extension
git submodule update

Setting up package manager and task runner

  • This project uses node package manger. If you have node.js installed, you can skip this step. If not, you need to install node.js.
  • This project uses grunt for automated tasks. See getting started for instructions how to install grunt on your system.

Adding extension to Google Chrome

  • Go to Google Chrome->settings->extensions.
  • Turn on Developer mode checkbox.
  • Press Load unpacked extension... and point to src folder of cloned project.
  • Aria2 integration integration extension should appear in installed extensions.

Making changes

  • Make changes to the project.
  • In Google Chrome extensions press Reload for this extension.
  • Test your changes in browser.
  • In project folder run grunt sync. All files needed for extensions should be copied to dist folder in project.
  • If you added any new files, make sure they are copied to dist folder. If not, change Gruntfile.js to copy these files. Refer to the globbing patterns and grunt-sync module documentation if you don't know how to do that.
  • Add dist folder as a new unpacked extension in Google Chrome and make sure everything works.
  • HTML, css, js minifying, package compression are to be done.