NotHereToPlayGames Posted May 18, 2023 Author Posted May 18, 2023 5 minutes ago, Anbima said: What is the easiest and best way to include polyfills? I use Tampermonkey.
Anbima Posted May 18, 2023 Posted May 18, 2023 32 minutes ago, NotHereToPlayGames said: I use Tampermonkey. Is there a "leaner" option which only embeds polyfills?
NotHereToPlayGames Posted May 18, 2023 Author Posted May 18, 2023 17 minutes ago, Anbima said: Is there a "leaner" option which only embeds polyfills? Proxomitron or Proximodo or Proxydomo.
NotHereToPlayGames Posted May 19, 2023 Author Posted May 19, 2023 6 minutes ago, rereser said: https://2ality.com/2022/04/change-array-by-copy.html four new polyfills are on the page.
NotHereToPlayGames Posted May 20, 2023 Author Posted May 20, 2023 I'm finding that having "too many" polyfill injections cause more problems then they solve (breaks Sedecordle, breaks MS Teams, just the first two I've found). For now, I just keep my list of polyfills disabled by default then enable them when needed as opposed to just injecting them all "just in case" they might be needed. Technically, I've yet to encounter these on any web site I ever visit.
NotHereToPlayGames Posted May 20, 2023 Author Posted May 20, 2023 1 hour ago, NotHereToPlayGames said: (breaks Sedecordle, breaks MS Teams, just the first two I've found) In both cases, it was only this polyfill that broke the page -- if (!Array.prototype.findLastIndex) { Array.prototype.findLastIndex = function (callback, thisArg) { for (let i = this.length - 1; i >= 0; i--) { if (callback.call(thisArg, this, i, this)) return i; } return -1; }; }
NotHereToPlayGames Posted May 20, 2023 Author Posted May 20, 2023 6 hours ago, rereser said: my posts for "Array.prototype.findLastIndex" , "Array.prototype.at" and "Array.prototype.findLast" polyfills have been edited. Awesome, thanks! I did miss the edit and also somehow missed the findLast. I can now keep all enabled without any page breaks.
NotHereToPlayGames Posted May 20, 2023 Author Posted May 20, 2023 6 hours ago, rereser said: no tests available yet for the latest four very new ones. I'm opting for this polyfill but do have the four "smaller" ones included-but-disabled in my Tampermonkey set of userscripts. Won't really know the best option until we can find an example web site or two.
NotHereToPlayGames Posted May 20, 2023 Author Posted May 20, 2023 The 2ality post specifically states "this blog post only demonstrates the new methods with Arrays, but they are also available for Typed Arrays". Typed Arrays are - Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array BigInt64Array BigUint64Array This (same link as earlier post) polyfill should work for Arrays and Typed Arrays.
NotHereToPlayGames Posted May 20, 2023 Author Posted May 20, 2023 45 minutes ago, rereser said: it does not slow down the browser so that is good. Agreed. I'm just keeping my full list of polyfills enabled since I'm seeing no more page breaks.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now