Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javascript code manipulating the query string are not working #400

Open
benoit74 opened this issue Sep 23, 2024 · 0 comments
Open

Javascript code manipulating the query string are not working #400

benoit74 opened this issue Sep 23, 2024 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@benoit74
Copy link
Collaborator

While the querystring is usually more targeted for server usage, there is some Javascript code (running in the browser) which is using these querystrings as information to trigger specific behavior.

One example (encountered on libretext) is MathJax (2 at least). MathJax is loaded with a code like <script type="text/javascript" src="path-to-MathJax/MathJax.js?config=xxxx"></script>. MathJax uses the config=xxxx to know which configuration file(s) to load.

This is currently broken in warc2zim because of the decision we took to escape all querystrings (see the long discussion on pros and cons on #206). Querystrings are not query string anymore, and the JS code fails to find it.

Not sure how to fix it given the cons we know about keeping querystrings as-is. At least this should be more clearly documented.

Maybe escaping and keeping the querystring could be the solution (e.g. using something like <script type="text/javascript" src="path-to-MathJax/MathJax.js%3Fconfig%3Dxxxx?config=xxxx"></script>, with the ZIM entry at path-to-MathJax/MathJax.js?config=xxxx.

@benoit74 benoit74 added the bug Something isn't working label Sep 23, 2024
@benoit74 benoit74 added this to the backlog milestone Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant