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

Make library work with more browsers by polyfilling replaceAll() #1051

Closed
Jaifroid opened this issue Feb 12, 2024 · 0 comments · Fixed by #1054
Closed

Make library work with more browsers by polyfilling replaceAll() #1051

Jaifroid opened this issue Feb 12, 2024 · 0 comments · Fixed by #1054

Comments

@Jaifroid
Copy link
Member

Jaifroid commented Feb 12, 2024

In this file https://github.com/kiwix/libkiwix/blob/main/static/skin/viewer.js#L76, a replaceAll() method is used that is incompatible with a number of older browsers. We at Kiwix JS have found several cases where the fancy library cannot be used simply because of this method (e.g., any Chrome before 85, see https://caniuse.com/?search=replaceAll), even though the browser would otherwise support the library feature.

We tried to polyfill it ourselves, but due to CORS its' not possible for us to tamper with this script.

For more info see kiwix/kiwix-js#1174 and kiwix/kiwix-js#1190. And for a very small polyfill that could simply be added to the viewer.js without needing to download a package, see https://github.com/kiwix/kiwix-js/pull/1190/files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants