aprzn123 / TheThirdCan

A browser extension designed to improve https://twocansandstring.com
MIT License
7 stars 4 forks source link

suggestion: fetch `tex-mml-svg.js` from a CDN instead #2

Closed HumanoidSandvichDispenser closed 1 year ago

HumanoidSandvichDispenser commented 1 year ago

I would like to suggest moving the src/injected/tex-mml-svg.js script out of version control and fetching it from a CDN instead. The script is quite large (about 2.1M), and keeping it in version control increases the repository size and slow down git. In addition, text editors with file previewers and pickers can often freeze as it tries to parse the script.

Instead, we can use a CDN such as this https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-svg.min.js to serve the script. This would allow us to keep the repository size small.

Please let me know your thoughts on this.

aprzn123 commented 1 year ago

It would be preferable, yes, but I'm pretty sure that Mozilla has a policy against add-ons that pull code from external pages. Let me know if I'm missing something there, though.

HumanoidSandvichDispenser commented 1 year ago

I see, I didn't know about that. It looks like there isn't an easy solution.

My original problem was that my text editor freezes every time the file picker selects that file, but the workaround for that is to ignore it locally by adding src/injected/tex-mml-svg.js to .git/info/exclude.