-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
Fancy library doesn't work in browsers that do not support replaceAll #1174
Comments
Actually, it's not yet in core-js 3. It's scheduled for 4 (a proposal). We can get a polyfill like this:
And where needed:
This would have to be added to the dependency grid. See https://github.com/kiwix/kiwix-js/blob/main/ADDING_DEPENDENCIES_NODE_MODULES.md for the method to do this. |
@Rishabhg71 This is one that could interest you, as it could effectively fix your library feature for a wider range of browsers. |
Will it be possible to "artificially" define a string.prototype.replaceAll method in the global scope of the program as a temporary fix for this issue until the release? |
@Greeshmanth1909 I'll entertain any appropriate fix! We're probably a couple of weeks away from releasing v4.0, and it would certainly be good to get this fixed before that release. I don't think replaceAll should be too hard to emulate, and a full polyfill may be overkill. |
@Greeshmanth1909 has discovered that this cannot be polyfilled in Kiwix JS due to CORS. However, it could be fixed upstream in kiwix-tools. |
replaceAll()
is used to construct the magnet link, and this throws an error in browser < Chrome/Edge 85 and Firefox 77. To be clear, this error only surfaces when you try to download a file. But as this is the whole point of the library, it really needs to be fixed...See https://caniuse.com/?search=replaceAll.
We should probably polyfill that anyway, as the polyfill is available in core-js.
The text was updated successfully, but these errors were encountered: