help-librejs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with liberating MathJax on my website: are wildcards supported?


From: Yuchen Pei
Subject: Re: Help with liberating MathJax on my website: are wildcards supported?
Date: Sun, 19 Nov 2023 08:52:39 +1100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Hello,
On Sat 2023-11-18 19:12:50 +0000, John Scott wrote:

> Hi,

> I'm using MathJax v2 on my personal web page at
> https://johnscott.me/math and I'm trying to mark the page so that
> LibreJS knows that MathJax is under the Apache 2.0 license and
> therefore free. The only problem is that MathJax is rather big, and
> the names of the different JavaScript files it loads may differ
> depending on what browser or device you're using; it's not possible
> for me to test all possible combinations of configurations to figure
> out what JavaScript files might be used.

> Is it possible for me to, in the table, use a wildcard to indicate
> that all JavaScript files below the /mathjax/ directory are under a
> particular license? I haven't figured out how to pull this off.
> Thanks,
> John

I am not aware that it is possible for a user to add a wildcard
whitelist like this in librejs. One way to achieve this would be to add
a feature to LibreJS so that it can read configurations from a text file
e.g. ~/.librejsrc or ~/.config/.librejsrc, which serves as a user
friendly alternative to the opaque database blob that nobody but only
firefox understands:

https://stackoverflow.com/questions/54920939/parsing-fb-puritys-firefox-idb-indexed-database-api-object-data-blob-from-lin/59923297#59923297

Meanwhile, a workaround to your problem could be to prepend and append a
line to all files under /mathjax/ directory:

Prepend this line

# pre.txt
// @license 
magnet:?xt=urn:btih:8e4f440f4c65981c5bf93c76d35135ba5064d8b7&dn=apache-2.0.txt 
Apache-2.0

Append this line

# post.txt
// @license-end

So, something like this

for f in ./mathjax/*; do cat pre.txt $f post.txt > ${f}_new; mv ${f}_new $f; 
done

[1] https://ypei.org/js/mathjax/config/TeX-AMS_CHTML.js

Best,
Yuchen

--
Dr Yuchen Pei | https://ypei.org | Timezone: UTC+11
PGP Key: 47F9 D050 1E11 8879 9040  4941 2126 7E93 EF86 DFD0
https://ypei.org/assets/ypei-pubkey.txt

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]