#Simplest way to get polyfilled/transpiled raw JS code for .replaceAll()?
10 messages · Page 1 of 1 (latest)
Basically I have a very old browser, think IE11. It partially works with the site I want but it is missing some feaures, namely
.fromEntries
.replaceAll
globalThisNow, I found some hacks and manually made "shims" for these, which I inject before any o fthe page's JS code and now these work but I finally arrived at
ReadableStream
https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream
and this is where things became ogre.
Basically what I need is standalone transpiled code for this I can just inject in old browser.
Bot is too aggressive on link spam
The thing about streams is that they're not from tc39, it's a browser thing, so you won't find a quick ponyfill like for the other features
You don't need a framework 🤔
In most cases, you can find a link for a polyfill on MDN https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream#see_also
Yes but that's not a framework
A framework is a set way of doing things
here you are simply providing functionalities your outdated browser doesn't have
To get readable streams? Try and read the link https://github.com/MattiasBuelens/web-streams-polyfill?tab=readme-ov-file#usage
easiest solution is to use regex e.g
word.replaceAll(" ", x)
word.replace(/\s/g, "x")