Skip to content

Building

Jorys Paulin edited this page Jul 30, 2018 · 1 revision

If you wish to build the extension yourself, or you want to add code to it, this guide will help you.

Get the code

You can get the code in different ways:

  • Cloning the repo via git: git clone https://github.com/moonlight-stream/moonlight-chrome
  • Getting the code as a zip ("Clone or download" > "Download zip" or via the releases tab, see "Source code (zip)")

Once completed, you'll have a directory (here named moonlight-chrome) containing the code of the application. Go inside it and install the requirements.

Requirements

Make sure they are properly installed by starting your console and typing: git --version and python --version. If no error is printed inside the console, you're good to go!

Install the Chrome Native App SDK

This is quoted from the pepper.js wiki.

  • Install the NaCl SDK. Set the NACL_SDK_ROOT environment variable to be an absolute path that points to the desired pepper_* directory inside of the NaCl SDK. For example, to temporarily set the environment variable:
set NACL_SDK_ROOT=c:\path\to\nacl_sdk\pepper_*  (Windows)
export NACL_SDK_ROOT=/path/to/nacl_sdk/pepper_*  (Almost everything else)

Moonlight uses the latest version of Pepper, which you can get here

Compiling the NaCl module

The compile process has been done in Windows only for now

  • Go to the directory where you downloaded the code: cd moonlight-chrome for example
  • Open up your console: Shift+RightClick on Windows
  • Type in git submodule update --init --recursive to init git submodules required for building
  • Type in make.bat: the console should log some information
  • When it's done, you can move over to the final step

Adding the extension in Chrome

  • Go to chrome://extensions
  • Tick "Developer mode"
  • Click "Load unpacked extension"
  • Go to the directory where you installed Moonlight (select its name)
  • Moonlight should appear in the list

Launch it by clicking "Launch" in the extensions list or via chrome://apps. If making changes, don't forget to reload the extension by clicking "Reload" in chrome://extensions and running make if you've changed the NaCl module! Chrome will now remember you that you have an unpacked extension that could lead to security problems. To remove this message, we recommend you disable the extension when you're not using it.