tosdr / browser-extensions

Browser extensions for Terms of Service; Didn't Read. “I have read and agree to the Terms” is the biggest lie on the web. We aim to fix that. Get informed instantly about websites' terms & privacy policies, with ratings and summaries from the www.tosdr.org initiative.
http://tosdr.org/downloads
GNU Affero General Public License v3.0
393 stars 44 forks source link

Replace jQuery with plain JavaScript #29

Closed oslego closed 3 years ago

oslego commented 5 years ago

The web extension manifest references jQuery which comes in at a size of 87kb. However, the only uses of jQuery seem to be in simple DOM manipulation in popup.js.

Given that web extensions are guaranteed to run in modern environments, thus obviating the need for backwards compatibility provided by jQuery, and the limited functionality being used, would you consider accepting a PR to replace jQuery with equivalent vanilla JavaScript?

I propose relying on JavaScript template literals and the <template> HTML element for generating and manipulating the markup of the popup file. Both of these features enjoy full support in the environments that run web extensions: Chrome, Firefox, Edge, Opera.

I can see a slightly different codebase in the gh-pages branch of this repository which seems to indicate the use of the popup code as a bookmarklet. I don't know how far back it is intended to provide backwards compatibility (thus maybe requiring jQuery), but I can also see that the code between gh-pages and master has diverged significantly. I don't know what maintenance plan, if any, there is for the standalone popup code (i.e. not the popup used in the web extension).

Vinnl commented 5 years ago

It sounds like a no-brainer to me to accept such a PR. @michielbdejong if we accept such a PR, who is then able to release updated versions of the extensions to the Chrome Web Store and Mozilla Add-Ons?

oslego commented 5 years ago

Is there any concern with the code base for the web extensions from the master branch diverging even more from the one that seems to be for a standalone popup in the gh-pages branch?

michielbdejong commented 5 years ago

@Vinnl yes, I have publish permissions for both the Chrome and the Firefox one.