Skip to content
Reddit Enhancement Suite
JavaScript CSS HTML
Latest commit 89cef8a May 19, 2016 @erikdesjardins erikdesjardins Update #2906: Captions position (#2990)
* showImages: Add options to display captions above or below images

* showImages: implement captionsPosition with flex order
Failed to load latest commit information.
assets RES logo source Apr 30, 2016
chrome codepen expandos May 8, 2016
edge This never happened. May 10, 2016
examples docs: remove references to "adding a module to manifests" May 7, 2016
firefox firefox: ioService.newURI cares about the number of arguments, even i… May 17, 2016
lib Update #2906: Captions position (#2990) May 19, 2016
node replace indexOf with includes and startsWith May 11, 2016
safari codepen expandos May 8, 2016
utils wikiCheck: convert to addModule() Dec 12, 2015
.babelrc webpack: support for building multiple browsers Apr 25, 2016
.babelrc.json safari: add transform-runtime to take care of `regeneratorRuntime` Apr 29, 2016
.codeclimate.yml codeclimate: Remove NSP Jan 28, 2016
.editorconfig Create EditorConfig file based on project coding style May 21, 2014
.eslintignore ensure that .eslintignore does not ignore lib/utils Apr 25, 2016
.eslintrc.json Update deps (#2987) May 17, 2016
.gitignore gitignore: Remove unused and fix existing rules Dec 31, 2015
.scss-lint.yml update to eslint 2.0.0, move linting out of gulp Mar 12, 2016
.travis.yml update deps and add Node 6 to tests May 8, 2016 readme update, build instructions split off Apr 10, 2013 changelog Mar 16, 2016 Initial notes on publishing procedures Mar 12, 2016
LICENSE Add LICENSE file (wget gpl-3.0.txt) - fixes #241 Sep 15, 2013 readme: remove redirects from links May 10, 2016
appveyor.yml update deps and add Node 6 to tests May 8, 2016
gulpfile.babel.js linting: switch from sort-imports-es6 to import/order (#2937) May 6, 2016
icon128.png updated icons / including new ones Aug 14, 2012
icon16.png updated icons / including new ones Aug 14, 2012
icon256.png icon for safari store Mar 12, 2016
icon48.png updated icons / including new ones Aug 14, 2012
icon64.png updated icons / including new ones Aug 14, 2012
package.json Update deps (#2987) May 18, 2016
webpack.config.babel.js dashboard: replace base64 loading icon with local image May 11, 2016

Reddit Enhancement Suite

Travis Build Status AppVeyor Build Status Coverage Status Code Climate devDependency Status Chat on IRC

Reddit Enhancement Suite (RES) is a suite of modules that enhances your Reddit browsing experience.

For general documentation, visit the Reddit Enhancement Suite Wiki.


Hi there! Thanks for checking out RES on GitHub. A few important notes:

  1. RES is licensed under GPLv3, which means you're technically free to do whatever you wish in terms of redistribution as long as you maintain GPLv3 licensing. However, I ask out of courtesy that should you choose to release your own, separate distribution of RES, you please name it something else entirely. Unfortunately, I have run into problems in the past with people redistributing under the same name, and causing me tech support headaches.

  2. I ask that you please do not distribute your own binaries of RES (e.g. with bugfixes, etc). The version numbers in RES are important references for tech support so that we can replicate bugs that users report using the same version they are, and when you distribute your own - you run the risk of polluting/confusing that. In addition, if a user overwrites his/her extension with your distributed copy, it may not properly retain their RES settings/data depending on the developer ID used, etc.

I can't stop you from doing any of this. I'm just asking out of courtesy because I already spend a great deal of time providing tech support and chasing down bugs, and it's much harder when people think I'm the support guy for a separate branch of code.


Steve Sobel

Contributor guidelines

Thinking about contributing to RES? Awesome! We just ask that you follow a few simple guidelines:

  1. RES has grown quite large, so we do have to pick and choose what features we should add. Code bloat is always a concern, and RES is already rather hefty. If you're unsure if your feature would appeal to a wide audience, please post about it on /r/Enhancement or contact @honestbleeps directly to ask.

  2. There are a few features we have made a conscious choice not to add to RES, so make sure whatever you'd like to contribute isn't on that list.

  3. It would be greatly appreciated if you could stick to a few style guidelines:

    • please use tabs for indentation
    • please use spaces in your if statements, e.g. if (foo === bar), not if(foo===bar)
    • please use single quotes ' and not double quotes " for strings
    • please comment your code!
    • please consider using npm run lint (see below) to verify your code style
  4. If you're adding new modules or hosts, see below.

Project structure

Top level files and folders
  • YOU ARE HERE, unless you're browsing on GitHub
  • changelog.txt: self-explanatory
  • gulpfile.babel.js: build script
  • package.json: package info, dependencies
  • lib/: all RES code
  • lib/core/: core RES code
  • lib/modules/: RES modules
  • lib/vendor/: RES vendor libraries
  • chrome/: Chrome-specific RES files
  • firefox/: Firefox-specific RES files
  • safari/: Safari-specific RES files
  • dist/: build output
  • **/__tests__: unit tests
Chrome files
  • background.js: the "background page" for RES, necessary for Chrome extensions
  • manifest.json: the project manifest
  • icon.png, icon48.png, icon128.png: icons!
Firefox files
  • index.js: this is Firefox's sort of "background page" for RES, like what Chrome has, but just a JS file
  • package.json: the project manifest for the Firefox add-on
Safari files
  • background-safari.html: the "background page" for RES, necessary for Safari extensions
  • Info.plist: the project manifest
  • icon.png, icon48.png, icon128.png: icons!

Building development versions of the extension

First time installation:

  1. Install node.js (version >= 5).
  2. Install Python 2 (not version 3).
  3. Navigate to your RES folder.
  4. Run npm install.

Once done, you can build the extension by running npm start. This will also start a watch task that will rebuild RES when you make changes (see Advanced Usage for more details).

To load the extension into your browser, see the sections below.

Details and advanced usage

npm start [-- <browsers>] will clean dist/, then build RES (dev mode), and start a watch task that will rebuild RES when you make changes. Only changed files will be rebuilt.

npm run once [-- <browsers>] will clean dist/, then build RES (dev mode) a single time.

npm run build [-- <browsers>] will clean dist/, then build RES (release mode). Each build output will be compressed to a .zip file in dist/zip/.

<browsers> is a comma-separated list of browsers to target, e.g. chrome,firefox,safari,node. By default, chrome will be targeted.

npm run lint will verify the code style (and point out any errors) of all .js files in lib/ (except lib/vendor/) using ESLint, as well as all .scss files with scss-lint.

Note: You will need to install Ruby and run npm run external-deps before using npm run lint.

Helpful note: npm run lint-fix can autofix many whitespace and separator-related lint issues.

npm test will run unit tests (in __tests__ directories).

Building in Chrome
  1. Go to Menu->Tools->Extensions and tick the Developer Mode checkbox
  2. Choose Load unpacked extension and point it to the dist/chrome folder. Make sure you only have one RES version running at a time.
  3. Any time you make changes to the script, you must go back to the Menu->Tools->Extensions page and Reload the extension.
Building in Firefox
  1. Install jpm using npm: npm install -g jpm
  2. Navigate to dist/firefox and run the command jpm run, which should launch a new Firefox browser using a temporary profile with only RES installed.
Building in Safari (assumes Mac)
  1. Open the Preferences by going to Safari->Preferences or pressing ⌘,, then go to Advanced and check the checkbox for Show Develop menu in menu bar.
  2. Navigate to Develop->Show Extension Builder to open the extensions builder. Add a new extension by pressing the + in the bottom left and choosing Add Extension.
  3. Navigate to the dist/RES.safariextension folder for RES and select it.
  4. If you are using Safari 9+, you should be able to install the extension without enrolling in the Apple Developer Program; however, the extension will be auto-uninstalled when you quit Safari.

    If you use an older version of Safari or find the auto-uninstall annoying, you need to purchase a proper certificate by signing up for the Apple Developer Program (currently $99/yr).

Accessing nightly builds

In addition to building your own version of RES, you can download older (or current) builds of RES for testing purposes.

(Almost) every commit to master is quickly archived away at; if you would like access to this database, please contact /u/allthefoxes on reddit or email

All that is asked is that you have at least one previous contribution to RES.

Adding new files


See examples/module.js for an example.

Create a new .js file in lib/modules. It will automatically be loaded when the build script is restarted.

Inline image viewer hosts

Please be sure that they support CORS so the sites do not need to be added as additional permissions, which has caused headaches in the past.

See examples/host.js for an example.

Create a new .js file in lib/modules/hosts. It will automatically be loaded when the build script is restarted.


Create a new Sass partial under lib/css/ (with a leading underscore, e.g. _myPartial.scss). Import the file in lib/css/res.scss (i.e. @import 'modules/myPartial';—do not include the underscore or file extension).

Body classes will be automatically added for boolean and enum options with the property bodyClass: true, in the form .res-moduleId-optionKey for boolean options (only when they're enabled), and .res-moduleId-optionKey-optionValue for enums. This is the preferred way to create optional CSS; do not use addCSS() unless absolutely necessary (i.e. variable color, size, etc.).

Something went wrong with that request. Please try again.