snipe/downworthy — pull request #16 by mrwillis21 (2014-01-24 23:09:46+00:00)
Title: Building in ability to include external JSON files as "replacement dictionaries".

Love this extension. Hyperbolic clickbait headlines make me want to ram bicycle spokes in my eyes. :)

Your to-do list specified that you wanted to have separate "modes" for the extension, such as "Cynical Millenial", etc. You also mentioned having the string replacement hosted on S3.

I figured both goals could be best accomplished by pulling out the string replacements into separate dictionary files.

This branch includes my changes which retrieve the replacements from a JSON dictionary file and apply them from the file, rather than being hard-coded into the content script. The dictionary file currently resides within the extension itself, but could be retrieved from an external source, such as S3. Currently the user functionality is exactly the same as it was before.

In the process, I've also tried to clean up the code as much as I could, pulling out many reusable functions and constants - that's why the diff is so crazy. :)

I intend to make further improvements, but I wanted to go ahead and make this pull request because there is such a large diff, and merging later would be tougher.

I hope you like the updates, and thanks for this cool idea! :)