Jump to content

Polyfill: What's all this, then?


TrevMUN

Recommended Posts

1 hour ago, Sergiaws said:

I think that sometimes frameworks are useful, maybe not React or Angular, maybe these frameworks are overbloated, but I think maybe old JQuery could be useful. I still remember the time when I used in the school youtube with IE8 in XP. In my opinion, we can consider that as Web 2.0! Moreover, Twitter, Facebook and other social networks had been here since 2000s decade so these websites/applications/whatever worked in old browsers like Netscape and IE6/7/8! So, in my opinion, lots of added functions are unnecesary! That's why I wanted to know what is the latest JQuery for these old browsers!

In the end, maybe we can (with an userscript or something like that) search the script tag which point to the JQuery source and replace it with another script tag which would point to an older JQuery. Don't forget too that Joomla and other stuff still support XP and other older browsers/systems! There are even pages which don't use js (specially in the TOR network), so I just consider using js for Ajax, modify some html tags and nothing more!

I do not like the JS frameworks at all because today's developers just get them and throw it in a project and call it a day. I'd rather develop a project from zero without any third party libraries, pretty vanilla and old school style. But this doesn't make money in today's Web 2.0 world, unfortunately. I despise JS frameworks, although I do acknowledge that they are good and look good, they don't look like how I think the Web should be. I don't wanna open a browser to run a web app or a page 100% built in a JS framework knowing that my browser will not support it at all in the next years.

Twitter (2006), Facebook (2003), Youtube (2005) nowadays make an extensive usage of JS frameworks and libraries, to add these unnecessary features. jQuery's first release was in 2006, four years after XP was released and 2-3 years before the last official XP update (POSReady update, not for the public in general).

jQuery and JS nowadays is being overused in a multitude of projects, when in reality you don't need it at all because HTML5 and CSS3 are now very powerful. You can do a carousel or an accordion without any line of JS at all.  I'm a 100% full HTML/CSS guy, old school style. I always try to find ways to make the same thing these modern things do, with just pure HTML/CSS.

As for your idea, I think it is not feasible because many features used by modern sites didn't exist when vanilla JS and initial releases of jQuery were around. Linkedin's usage of PerformanceObserver, for example, wouldn't be possible. And I wouldn't want to have it anyway, because JS like this one eats a lot of memory. And old systems like XP with Pale Moon tend to choke with it because there's just not enough memory for that task. I'm in a brand new, modern 16GB notebook and sometimes a tab running facebook in my browser eats so much RAM that I have to close it when it locks up. Blame it on facebook devs.

For my personal projects, I try to avoid JS as much as possible and to a minimal vanilla usage. My current personal website uses bootstrap and jQuery, but my next-gen version will be pure html old school. I just need time to develop it. As for my professional works, I try to convince the developers to take the CSS route where appropriate and convince them about it because not only it's easier, but also better performance and a better cross-browser compatibility.

Link to comment
Share on other sites


On 4/6/2022 at 6:20 PM, UCyborg said:

You take the content of polyfills.js and add the metadata block like the one below at the top. There are additional options that are supported by user script managers, their docs are your friend, but these should be sufficient for now.

// ==UserScript==
// @name         chromefill
// @namespace    http://yourwebsiteorjustuniquestringyouwilluseforyourscripts.net/
// @version      0.1
// @description  Automatically injects polyfills for older browsers into webpages
// @author       Your name
// @match        *://*/*
// @run-at       document-start
// @grant        none
// ==/UserScript==

I could not get this to work with Tampermonkey v4.13 and 360Chrome v11.

I had to also go into the userscript's settings tab and set "Run only in top frame" to NO.

But this would only get "half" of GitHub to work, the file descriptions and dates would fill in but the button to the left of the green Code button would not.

@InterLinked's chromefill does work as an extension, but I would prefer for it to work via Tampermonkey.

Link to comment
Share on other sites

2 hours ago, Bruninho said:

I do not like the JS frameworks at all because today's developers just get them and throw it in a project and call it a day. I'd rather develop a project from zero without any third party libraries, pretty vanilla and old school style. But this doesn't make money in today's Web 2.0 world, unfortunately. I despise JS frameworks, although I do acknowledge that they are good and look good, they don't look like how I think the Web should be. I don't wanna open a browser to run a web app or a page 100% built in a JS framework knowing that my browser will not support it at all in the next years.

Twitter (2006), Facebook (2003), Youtube (2005) nowadays make an extensive usage of JS frameworks and libraries, to add these unnecessary features. jQuery's first release was in 2006, four years after XP was released and 2-3 years before the last official XP update (POSReady update, not for the public in general).

jQuery and JS nowadays is being overused in a multitude of projects, when in reality you don't need it at all because HTML5 and CSS3 are now very powerful. You can do a carousel or an accordion without any line of JS at all.  I'm a 100% full HTML/CSS guy, old school style. I always try to find ways to make the same thing these modern things do, with just pure HTML/CSS.

As for your idea, I think it is not feasible because many features used by modern sites didn't exist when vanilla JS and initial releases of jQuery were around. Linkedin's usage of PerformanceObserver, for example, wouldn't be possible. And I wouldn't want to have it anyway, because JS like this one eats a lot of memory. And old systems like XP with Pale Moon tend to choke with it because there's just not enough memory for that task. I'm in a brand new, modern 16GB notebook and sometimes a tab running facebook in my browser eats so much RAM that I have to close it when it locks up. Blame it on facebook devs.

For my personal projects, I try to avoid JS as much as possible and to a minimal vanilla usage. My current personal website uses bootstrap and jQuery, but my next-gen version will be pure html old school. I just need time to develop it. As for my professional works, I try to convince the developers to take the CSS route where appropriate and convince them about it because not only it's easier, but also better performance and a better cross-browser compatibility.

I'm totally agree with you! A lot of things can be done with html5 and css. But, what about Ajax stuff? And another question, where is possible to search the compatibility of a js function? Is interesting to see how some Ajax functions work in Netscape but other stuff don't work. You can see that if you search the weather in google using netscape, only the actual weather will be displayed. I'll made an experiment, I'll try to backport the weather App which I did to Netscape and similar browsers. Maybe I'll downgrade the version of JQuery. Another option would be to make it completely with php or node.js. Graceful degradation is really interesting concept!

Link to comment
Share on other sites

1 hour ago, Sergiaws said:

I'm totally agree with you! A lot of things can be done with html5 and css. But, what about Ajax stuff? And another question, where is possible to search the compatibility of a js function? Is interesting to see how some Ajax functions work in Netscape but other stuff don't work. You can see that if you search the weather in google using netscape, only the actual weather will be displayed. I'll made an experiment, I'll try to backport the weather App which I did to Netscape and similar browsers. Maybe I'll downgrade the version of JQuery. Another option would be to make it completely with php or node.js. Graceful degradation is really interesting concept!

Back when Ajax did not exist, things were made in ASP (and later PHP) without modals and popups or whatever updating the page in question... it was spanned across several pages or reloading the same page.

Nothing against Ajax at all... an excess of Ajax calls can also choke the browser. I have a Moodle block that chokes once in a while because of a timeout when it cannot find the data to display.

Link to comment
Share on other sites

Added customElements to YouTube and now have live previews (animated thumbnails) in search results on Pale Moon. Also spoofing user agent as Firefox 96. I haven't determined the oldest version they pick to use customElements.

Did they remove them on the related / suggested videos on the right side? Never mind, depends on the video.

One thing about Babel, you may want to pay attention to source type setting. "Script" is probably correct for most (all?) of the time. For one thing, "Module", where the name implies special kind of JS file, it also always adds "use strict;". The code you're pasting from random scripts may use features of the language that "use strict;" prevents from working.

Edit: got stackoverflow.com's full-anon.en.js also transpiled. Again, no account to login, but the site seems to work correctly at the first glance.

Edited by UCyborg
Link to comment
Share on other sites

3 hours ago, UCyborg said:

One thing about Babel, you may want to pay attention to source type setting.

Noted, thanks.

My saga - I've stumbled into a rather surprising find.  American Water's billpay web site has this .js  --  https://mywaterv2.amwater.com/main-ui/solutions/enhancedportal/js/googleAnalytics.js?=@2.3.2.3-RELEASE-1648758222340

They're using a GOOGLE ANALYTICS script that they saved to their own domain and the billpay sites will not work if you block this GOOGLE ANALYTICS script.

Link to comment
Share on other sites

As of now, my American Water billpay web site is the only site I have to visit that requires a polyfill javascript engine.

Consumer choice always has a choice, if your weather forecast web site stops working because you prefer XP and a non-polyfill web browser, you can always find a different weather forecast web site.

But I can't do that with American Water, I have to use their web site  :(

But I don't have to use "all" of their web site - I only need to log in, see how much I owe, then log out.  I make the payment from my checking account access, not the billpay web site.

 

So...

The login web page plus the landing page after you log in is 225 unique .js files.  (This in-and-of-itself is just plain stupid!).

I can ignore the login web page, I can log in fine without polyfill.

The landing page after you log in is what does not work without polyfill - and that page has 157 unique .js files (one or two of these is actually injected by my Proxomitron config).

I've been able to eliminate 127 of those 157 .js files - I can view the landing page, my balance due, the due date, and can log off.

So one of these 30 remaining .js files is my culprit (minus the one or two injected by Proxomitron).

 

Fingers still crossed, I would love to get this web site to no longer require a "modern" web browser!

 

This has been a learning experience, that's for sure.  American Water has a .js file for disputing your bill, a .js file to report a duplicate bill, a .js file for adjusting your bill, a .js file to disconnect or reconnect service, a .js file for a hardship loan if you can't pay your bill due to Covid, at least three .js files for water quality concerns, several .js files for viewing .pdf files as if our browser doesn't already know how to view them, paperless billing .js files, autopay .js files, change of address or moving .js files, time zone .js files, mailing address .js files, .zip .js files, high usage or water leak detected .js files, delinquent payment .js files, delinquent dispute balance .js files, print-preview .js files, conservation tips .js files, cash payment location .js files, et cetera.

It's like every department within American Water is responsible for their own departmental need .js files.

What a nightmare - none of them are "needed" as far as I'm concerned.  I just want to know how much I owe and when it is due!

Link to comment
Share on other sites

amwater.com...now that's one odd website. I don't think the issue is that the code can't execute due to trying to using unsupported features without checking for them, it gives the impression that it's just bugged somehow or rather gracefully degrades to non-functioning. :thumbdown Seriously, how can you mess up the ability to open login form so badly? Obviously transpiler is useless in this case since it will just regenerate the same code using different syntax while not altering the logic.

So you'd have to debug it. Debugger in old school Mozilla browsers seems kinda poor, do older incompatible Chromium browsers have at least de-minification function for JS files and ability to snoop events (keyboard, mouse etc.)? It'd be a place to start I guess.

I've made a small contribution to palefill, the script fixes for Stack Exchange websites and Reddit. Stack Exchange actually has over 170 websites. Assuming they all use that single problematic JS file, they should all be better now. And Reddit (redesigned one), while working now at first glance, makes my poorer Mozilla browsers unusable after opening the debugger while on it. Maybe if I took 64-bit browser, bought more RAM and waited for a while, loading would have made it to the end.:buehehe:

Still, getting from browser just gobbling up RAM no stop after invalid regexp group error to comment pages normally loading is quite a step forward.

Edited by UCyborg
Link to comment
Share on other sites

3 hours ago, UCyborg said:

I don't think the issue is that the code can't execute due to trying to using unsupported features without checking for them, it gives the impression that it's just bugged somehow or rather gracefully degrades to non-functioning. :thumbdown Seriously, how can you mess up the ability to open login form so badly?

Reminds me of a few years back when our production floor "IT" guy was so h#ll-b#nt on "everybody must use Firefox" that he (intentionally?) left out a closing </div> tag in some manufacturing process lookup tables.

It resulted in <tr> and <td> column widths only lining up properly in Firefox.  Do not recall "why", but Firefox would render the columns correctly despite the missing </div> tag.

I was using Ungoogled Chromium plus Stylus at the time and all I did was convert some display:flex entries to display:block and the column widths looked correct on my computer despite boycotting IT's "everybody must use Firefox".

It was always fun to have the "IT" guy question why it looked correct without his beloved Firefox.

The "IT" guy got away with that for about a year and a half or so.

It was a college intern working for us one summer that "found" the missing </div> tag.

To this day most of us in the Engineering Department are convinced that the "IT" guy was doing it intentionally because he was h#ll-b#nt on "everybody must use Firefox".

Link to comment
Share on other sites

The only thing I had in common with my colleagues was that we all hated Internet Explorer. The trident engine just simply ignored web standards for years. When Edge came with Chromium's Blink engine, and MS was set to abandon IE, we all knew we were going to drop IE support from our product ASAP. Party time...

I used IE in the beginning, but when I discovered Netscape in mid to late 90's, it became my go-to browser for everyday. But I was still being asked to make websites support IE. When Netscape died, I switched to Firefox. Again, still asked to make them work on IE. Then Chrome came in, can't deny that I used it for a brief period of time before switching to Macs. From that point until today, I'm a loyal Safari user. Best browser I have ever used since Netscape. Firefox comes a close third place.

Whenever I need to use my Windows 10/11 VM, I go with Edge Chromium. I could go with Firefox but they no longer have the classic theme and they're obsessed with being "Chrome look alike". Forks of Firefox using that classic theme are outdated and no longer safe to use, so I avoid them for serious tasks. I have a XP VM with last supported SeaMonkey themed to look like classic Netscape, for whenever I want to visit some simple pages like forums or download something for XP from trusted sources. A 98 SE VM running my beloved Netscape for the same purposes. I read the news pages, forums, and that's it. No internet banking, no shopping, no personal data being used there.

The IE hate though, is still pretty much there. Imagine trying to develop a v2.0 of my personal website with classic old school HTML/CSS, only to make it work on IE for both Windows 3.x and 9x hahaha. Graceful degradation to the rescue, tho.

Nowadays, Chrome is the new IE. Yes, now Web standards are pretty much stable across all browsers, but Google's market web dominance and powerful presence in W3C, dictating the standards (because the majority of the browsers are using the same engine as Chrome), makes it harder for it to have any significant evolution. Chrome's development is pretty stale. We need competition between the browsers/rendering engines for the web to continue evolving.

Which was the same scenario in which Netscape and IE died...

Link to comment
Share on other sites

I only used Firefox for a span of three MONTHS or so, this was back in the late 90s.

I then found that tabbed-browsing GreenBrowser + Proxomitron + javascript "bookmarklets" added to the GreenBrowser "toolbar" gave me everything I needed and was more "secure" than the hype and propaganda that was pushing Firefox as "safe and secure".

I was working for a company that only had roughly 300 office employees but those offices were only 15 to 25 people spanning multiple networked locations (Indiana, Michigan, Illinois, Iowa, Texas, Alabama, Wisconsin, Mexico, Canada).

We didn't have an "IT" department, per se.  We had a "service desk" but it wasn't really called "IT".

I was never fond of Firefox and our "service desk" did push it as "safe and secure".

I LAUGHED MY BUTT OFF when I had stopped using it for six months to a year because my PLC DDE (Programmable Logic Controller Dynamic Data Exchange) [VisualBasic] interfaces did not display properly in Firefox.

We had the Indiana, Wisconsin, and Alabama offices shut down for two days because of a virus that was found to originate in a cubicle three cubes down from me and was spread through his FIREFOX to everybody on the network!

It didn't effect me but it was not because I was using a Trident-based "shell" (GreenBrowser), it was because I have never allowed javascript to run on ANY browser unless I specifically "whitelist" it.

Blacklist by default, whitelist what has been vetted and verified as "safe".

Link to comment
Share on other sites

On 4/8/2022 at 7:20 AM, Bruninho said:

Blame it on facebook devs.

Nah, not really, not in my opinion.

Blame it on MOBILE PHONES.

Web sites don't tend to design around the "desktop" anymore, it's all mobile phones.

Haven't looked, but somewhere I'm sure there are statistics on Facebook, Twitter, Instagram, et cetera and how many "phones" visit the site versus how many "desktops" visit the site.

Edited by NotHereToPlayGames
Link to comment
Share on other sites

I read somewhere regarding designing a website that as a business you can't afford to have a website that's not accessible from mobile devices.

2 hours ago, Bruninho said:

I could go with Firefox but they no longer have the classic theme and they're obsessed with being "Chrome look alike"

There are still CSS tweaks.

2 hours ago, Bruninho said:

Forks of Firefox using that classic theme are outdated and no longer safe to use, so I avoid them for serious tasks.

It's what most of the internet want you to believe. Yet, we have people here running XP and such browsers and they didn't get robbed because of it. Admittedly, I've also logged into my bank a few times in modern times on XP (2020+). :P

About banks, can someone enlighten me on why, when you have user + pass and a certificate, why replace the certificate with a smartphone app or Windows 10+ app? Why is this "better" and "more secure"?

On 4/7/2022 at 11:14 AM, Bruninho said:

If you want to insist on using XP, at least use an official provided Mozilla option.

Why though? Support for newer web bells and whistles is worse than in forks.

Link to comment
Share on other sites

i will have to politely disagree with @Bruninho regarding banking on XP.  (Most banking systems and ATM machines still use XP, last I recall but have not researched recently.)

Not sure why this has been such a "push" all of a sudden by Bruninho - I would love to see documented proof and not just hypotheticals.

I agree to disagree and I'm just trying to present the flip-side.

I would never in a thousand years have my DAD access his bank on XP - so I take Bruninho's side as far as DAD accessing his bank.

But my DAD has never heard of MSFN.org and wouldn't have the interest to spend more than 30 seconds here.

So advice herein is generally taylored to an entirely different audience.

 

46 minutes ago, UCyborg said:

Why is this "better" and "more secure"?

I personally would never visit my bank's web site on any smartphone!

I view it from the network level.

My XP connects to the bank via a wireless router and all wireless activity can be controlled and monitored "this side" of my router versus the "cable company side" of my router.

I have zero problem whatsoever in providing each and every one of you with my IP Address (but I won't).  Ping my router until your heart turns blue, you won't "see" my nine computers, just the "cable company side" of my router.

Perhaps that's overstating, but connecting to my bank via wireless "inside my network" is a totally different beast then connecting to a bank on a smartphone with a hundred or so "games" and "apps".

Then there are Privacy Disclaimers that nobody reads nor even "cares" if their Facebook app is "sharing" data with their banking app.

Privacy Data is always "shared" by default and you have to jump through some serious hoola hoops to "opt out", if you even can "opt out".

Edited by NotHereToPlayGames
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...