#Simplest way to get polyfilled/transpiled raw JS code for .replaceAll()?

10 messages · Page 1 of 1 (latest)

gritty field
gritty field
#

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
globalThis

Now, 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 🤔

#

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

gritty field
cursive turtle
#

easiest solution is to use regex e.g

word.replaceAll(" ", x)
word.replace(/\s/g, "x")