Skip to content
This repository was archived by the owner on May 11, 2021. It is now read-only.

Latest commit

 

History

History
62 lines (36 loc) · 2.21 KB

File metadata and controls

62 lines (36 loc) · 2.21 KB

Building

You need node/npm.

# Clone or download zip file
git clone git@github.com:arthurhammer/github-toc.git
cd github-toc

# Install development dependencies
npm install

# Build unpackaged extensions for testing and running locally
npm run build

# Build extensions packaged for distribution
npm run dist

Packaged and unpackaged builds live in the dist folder.

Testing in the Browser

Build the unpackaged extensions with npm run build. Then, install the extensions in the browsers as described below. Test it on the cases described in the test folder.

Google Chrome

Manually:

  • Open the extensions page in Chrome
  • Choose dist/chrome under “Load unpacked extension...”

Command line:

  • npm run chrome opens a new Chrome instance with the extension installed.

Chrome has to be closed for this to work. The path to Chrome is hard-coded, change if needed.

Firefox

Manually:

  • Open about:debugging in Firefox
  • Choose dist/firefox/manifest.json under "Load Temporary Add-on"

Command line:

  • npm run firefox opens a new Firefox instance with the extension installed.

See the documentation for Mozilla's web-ext tool.

Safari

  • Open Extension Builder in Safari
  • Add dist/safari.safariextension as existing extension
  • Click “Install”

Note: Unless you have a valid Safari Extension certificate, the extension will automatically be removed whenever you quit Safari. You will also not be able to build the packaged extension for direct install. The certificate requires a (paid) Apple Developer Program membership.

Userscript

Install dist/github-toc.user.js directly in the browser if supported or with your favorite userscript manager (such as Greasemonkey or Tampermonkey).