Skip to content

Latest commit

 

History

History
62 lines (49 loc) · 3.27 KB

contributing.md

File metadata and controls

62 lines (49 loc) · 3.27 KB

Contributing

Suggestions and pull requests are highly encouraged! Have a look at the open issues, especially the easy ones.

Notions

  • You will need to be familiar with npm and webpack to build this extension.
  • The extension can be loaded into Chrome or Firefox manually (See notes below)
  • JSX is used to create DOM elements.
  • All the latest DOM APIs and JavaScript features are available because the extension only has to work in the latest Chrome and Firefox. 🎉
  • Each JavaScript feature lives in its own file under source/features and it's loaded on condition in source/content.js.
  • Some GitHub pages are loaded via AJAX/PJAX, so some features need to be in the special ajaxedPagesHandler function (see it as a custom "on DOM ready").
  • See what a feature looks like and how it's loaded (in this case it uses observeEl to automatically be run when new comments are loaded via AJAX)
  • If you're making changes to the README, try to match the style of the content that's already there and when in doubt, take a look at our little style guide.

Workflow

First clone:

git clone https://github.com/sindresorhus/refined-github
cd refined-github
npm install

When working on the extension or checking out branches, use this to have it constantly build your changes:

npm run watch # Listen for file changes and automatically rebuild

Then load or reload it into the browser to see the changes (this does not happen automatically).

Loading into the browser

Once built, load it in the browser of your choice:

Chrome Firefox
  1. Open chrome://extensions;
  2. Check the Developer mode checkbox;
  3. Click on the Load unpacked extension button;
  4. Select the folder refined-github/distribution.
  1. Open about:debugging#addons;
  2. Click on the Load Temporary Add-on button;
  3. Select the file refined-github/distribution/manifest.json.

Firefox offers a more advanced loading technique that includes auto-reloading in the browser as well. Check-out web-ext run.