Skip to content

Latest commit

 

History

History
78 lines (54 loc) · 2.5 KB

README.md

File metadata and controls

78 lines (54 loc) · 2.5 KB

aoc-plugin

Plugin for Chrome, Firefox and Edge to log time when the adventofcode.com task was first opened (part 1 and part 2 separately)

Installation

Chrome

  • Download zip file from Releases
  • Unpack it into a directory
  • On chrome://extensions/ allow developer mode
  • Click on "Load unpacked" button and choose directory from above

Firefox

  • Download xpi file from Releases
  • On about:addons click cog icon and choose Install Add-on From File...

Edge

  • Download chrome zip file from Releases
  • Unpack it into a directory
  • On edge://extensions/ allow developer mode
  • Click on "Load unpacked" button and choose directory from above

Development

Manifest file

Manifest file is generated from manifest.input.json, by selecting either the "common" and "chrome" parts, or the "common" and "firefox" parts. To generate the manifest, run:

$ npm run prep-chrome

or

$ npm run prep-firefox

This will create manifest.json from manifest.input.json. The file manifest.json should NOT be committed to Git.

To do this without npm, check how the prep-* scripts inside package.json are implemented and run those commands directly.

Build and Test with Chrome

After executing npm run prep-chrome, you can load the git repo as an extension into Chrome (using 'Load unpacked" in developer mode).

Build and Test with Firefox

Build an unsigned addon using web-ext:

$ npm install
$ npm run prep-firefox
$ npx web-ext build

Then open about:debugging in Firefox and use the "Load Temporary Add-on" button to load the built addon .zip file from the output directory.

Run Lint

To check for javascript mistakes and Firefox manifest problems, run:

$ npm install
$ npm test

This will run eslint on JavaScript code and web-ext lint on the manifest. (It will replace manifest.json with the Firefox version in the process, since web-ext lint otherwise can't check it.)

CI/CD Process

The .zip file that is generated by GitHub Actions is created using build-chrome.sh (which is executed from .github/workflows/build.yml.

The .xpi file that is generated by GitHub Actions is created with a sequence of web-ext commands in .github/workflows/build.yml.

License

MIT