InterLinked1 / chromefill

Automatically injects polyfills for old Chromium into webpages
Apache License 2.0
15 stars 1 forks source link

This extension helps (but slows) Chrome 90 #4

Open Darthagnon opened 1 year ago

Darthagnon commented 1 year ago

I'm using Ungoogled Chromium v90 (only because it is updated manually, and I haven't got around to updating it yet). I've noticed random websites failing to load, with a whitescreen error as follows. Chromium v90 error

The browser console lists crbug1173575, non-JS module files deprecated.

Websites I've noticed this error on are mostly random e-commerce websites and (today) Sourceforge. I had assumed it was some browser caching error since my HDD is very full and I haven't cleared browsing data in a while, but once I added Chromefill to my browser, my test case Sourceforge loaded perfectly. (I did notice other webpages that work by default, e.g. Github loading slower, though).

InterLinked1 commented 1 year ago

The slowdown is likely due to the most recent commit, 916d50ced69c04c5d5672787ab9ac92f7c42cf4e.

This is somewhat experimental, and I've had the same issue myself. I'm wondering if the commit should be reverted in the meantime, it does help with some sites but it seems to have a runaway resource consumption problem with some pages that just crash, rather than loading in a broken manner. So your feedback here is insightful and valuable.

Could you try chromefill from a version prior to that commit and let me know if it works better?

The palefill project did a nice targeted auto transpiling of the nullish coalescing and optional chaining operators, which is a lot more lightweight than what the aforementioned commit attempted to do.

Vangelis66 commented 1 year ago

Why would OP use this extension in the first place? All the polyfills inside chromefill aim to reproduce Javascript functionality already extant inside Chromium 90:

globalThis, which provides this in global scope. This was only added to Chromium in version 71. fromEntries, which was only added to Chromium in version 73 queueMicroTask, which was only added to Chromium in version 71. Promise.any, which was only added to Chromium in version 85. Promise.allSettled, which was only added to Chromium in version 76. String.replaceAll, which was only added to Chromium in version 85. replaceChildren, which was only added to Chromium in version 86. Intl.RelativeTimeFormat, which was only added to Chromium in version 71. String.matchAll, which was only added to Chromium in version 73 (version 69 with optional flag enabled).

Even the "two villains", (?.)/(??), are natively supported in Ch90, so transpiling them, via babel, is unnecessary!

The palefill project did a nice targeted auto transpiling of the nullish coalescing and optional chaining operators,

... "They" did nothing of the sort :wink: ... Both operators have been now natively implemented in the platforms palefill targets (UXP and SeaMonkey):
(UXP closed issues:) https://repo.palemoon.org/MoonchildProductions/UXP/issues/1894 https://repo.palemoon.org/MoonchildProductions/UXP/issues/1658

so palefill feels "lightweight" (YMMV, depending on the age/specifics of your H/W) because it simply "polyfills"; unsupported RegEx is handled via Search-and-Replace patterns, just that...

Darthagnon commented 1 year ago

I might have been mistaken. I've had trouble opening SourceForge and Shopify/ecommerce websites in my browser (they just don't load with an ERR_INVALID_RESPONSE (I think that's a 501?). Sometimes, they do load, and I think I had a fluke where I installed this extension and the website then worked. However, the same problems resurfaced, so I don't know.

InterLinked1 commented 1 year ago

Yeah, it can be tricky to track down things like this. As Vangelis66 pointed out, this extension is mainly written for older versions of Chromium (personally, I use version 70, so that's what I was targeting mainly). The slowness however is definitely real and caused by the poor implementation of transpiling the operators. While it works and is functional, it's not optimal at all, so I'll leave this issue open.

Darthagnon commented 1 year ago

I think I found the answer to my problem of pages failing to load - uBlock Origin. I updated it from v1.33.2 to the latest v1.46, and a website that previously failed now works. Might be something worth trying for people, though I don't know how far uBlock Origin is backwards compatible. NeverDecaf's Chromium Web Store also requires v1.44.3 and no later on Manifest v2 browsers

InterLinked1 commented 1 year ago

Interesting, thanks for looking into that! I also use uBlock Origin, and it seems I have uBlock Origin 1.46.0 (it must automatically update for me). That might explain some things.

Darthagnon commented 1 year ago

After further investigation, I believe I found the cause of my problems. Narrowed things down a lot. But not the solution, yet.

Problem:

Websites failing to load. These are typically ecommerce websites, e.g. Ifixit's store, random minor Shopify websites (but not major providers like Gumroad, Amazon, eBay, Etsy), and occasionally SourceForge. I would get seemingly this issue: This site can't be reached, ERR_INVALID_RESPONSE and the browser console would display crbug/1173575, non-JS module files deprecated.

Not the solution:

It seemed temporary relief was provided by updating uBlock Origin, installing Chromefill. I am also using Ungoogled Chromium v90 (outdated), and other browsers, e.g. Brave (Chromium v109) open the websites just fine, but the issue persists in my primary browser. Changing DNS settings had no impact.

Still not The Solution

I had installed Telerik Fiddler Classic a while back. In Tools >> Options >> HTTPS, it was set to capture HTTPS traffic, for which purpose it installs its own certificates. I noticed that when I had Fiddler open, instead of websites failing to load with the above error, they would fail with "Your clock is ahead" (it was not; I'd just set the time by internet). I deduced that perhaps Fiddler's installed HTTPS certs were expired, and were causing issues even when Fiddler was not running. So I disabled Fiddler's HTTPS interception, and so far, all the ecommerce etc. websites are loading fine.

EDIT: aaaand it's back. Affected websites load precisely once, every time I enable or disable an extension. (hence why I thought chromefill affected things) I do suspect it's some sort of certificate error caused by Fiddler. I shold probably update Chromium, and then maybe it will disappear. Or reset my browsing data.