maksverver / astral-codex-eleven

A Chrome browser extension to speed up loading of posts on https://www.astralcodexten.com/ by replacing the comments widget.
MIT License
4 stars 2 forks source link

Add support for options #4

Closed Pycea closed 5 months ago

Pycea commented 5 months ago

Provides a way to add options to the extension. Options are objects that implement the options API, which requires a key and a default value, with the following functions being optional:

Saving and loading option values is handled automatically.

No options are implemented in this branch, but see here or other branches to see what they might look like.

Other changes

maksverver commented 5 months ago

Sorry about the delay. This change looks great overall (thank you for preparing it!), with two notes:

  1. There are a few small things I'd like to refactor, like avoiding global variables where possible, and normally I'd ask for that on the pull request, but since you have some follow-up changes prepared, I think it's better not to break those and refactor afterward.

  2. The changes in ext-comments.js break demo.html, which I use a lot for local testing.

I'll go ahead and merge this as is, and feel free to send me more pull requests for some of the actual option implementations you have in mind. Meanwhile, I'll try to fix demo.html which shouldn't be too difficult.