Jump to content

Polyfill: What's all this, then?


TrevMUN

Recommended Posts

9 minutes ago, Bruninho said:

See, this is why I hate JS... *sighs*

Heh, this is really fitting:

Quote

Things that can be done in JavaScript:

  • Drawing s*** all over the page
  • Drawing s*** with non-standard navigation all over the page.
  • Drawing s*** that downloads s***.
  • Spinning, jumping and beeping s***.
  • Turning nice, informational, stateless webpage into f****** self-aware crap, i mean, web application.

Source: https://bitcheese.net/web_browsers_must_die

Link to comment
Share on other sites


18 minutes ago, UCyborg said:

Heh, this is really fitting:

Source: https://bitcheese.net/web_browsers_must_die

Hahaha!

Going a bit off topic, here's what I'd rather do: 
1. https://youmightnotneedjquery.com
2. https://github.com/you-dont-need/You-Dont-Need-Javascript

As a web developer, I feel really embarrassed when people just shove jQuery and its frameworks/libraries in a page and call it a day. Things could be much simpler and more compatible with other browsers if these developers weren't so lazy. The problem lies in the fact that business need it done ASAP and they don't want to wait for us to produce a relative amount of code to overcome this when we can just throw a JS library...

Edited by Bruninho
Link to comment
Share on other sites

1 hour ago, UCyborg said:

Downloaded the problematic https://docs.microsoft.com/_themes/docs.theme/master/en-us/_themes/scripts/d48a1159.index-docs.js, copied its content into Babel to cleanse it of incompatible JS syntax. Saved the output into new index-docs.js and put it somewhere under html folder of Proxomitron Reborn proxy and added the following rule to its default.cfg under HTTP Headers section:

Wow!  I think that's the largest .js file I've witnessed in a long time.

image.thumb.png.82498b1ad14c651b117042f60275a78e.png

Link to comment
Share on other sites

1 hour ago, UCyborg said:

Tricks:

palefill with the following rule added to lib/main.js:

{
  selector: ["docs.microsoft.com"],
  fix: ["std-customElements", "std-PerformanceObserver", "std-queueMicrotask"]
}

How did you determine if this step is required or not?

As I may have to add this to "chromefill" since I'm trying this on 360Chrome v11 and you are using something Mozilla-based.

Link to comment
Share on other sites

Well, unless it's that lib/main.js portion, just changing the polyfills .js didn't get me anywhere.

Javascript console appears to be narrowing it down for me - to one or several of 109 "enhanced portal" .js files out of 179 "enhanced portal" .js files, and that's out of a total of 225 .js files altogether - just to pay my water bill !

Link to comment
Share on other sites

2 hours ago, UCyborg said:

How were you able to narrow down https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-createwindowexa issues to the index-docs.js file in particular?

Or was it a process of elimination and fairly easy with only having one global sub-folder .js and one scripts sub-folder .js?

How would one narrow down a web site with 225 .js files?

Link to comment
Share on other sites

7 hours ago, NotHereToPlayGames said:

Wow!  I think that's the largest .js file I've witnessed in a long time.

Yeah, no way the menu actually needs that much. Or does it? Hm, there is actual index-docs.js on MS server without that seemingly random prefix in its name. Wonder how it's different from prefixed version.

6 hours ago, NotHereToPlayGames said:

How did you determine if this step is required or not?

Error about undefined customElements in the browser console. About the other two, I noticed JS file with deprecation in its name that checked for JS features to determine whether it should show the unsupported banner.

6 hours ago, NotHereToPlayGames said:

As I may have to add this to "chromefill" since I'm trying this on 360Chrome v11 and you are using something Mozilla-based.

I've yet to try copying stuff from palefill's polyfills.js to chromefill's polyfill.js. They're implemented differently, so straight copy-paste won't work, will need slight adjustment at least if we even dare to hope it works. palefill also pulls Shadow DOM from another file online when that is requested.

5 hours ago, NotHereToPlayGames said:

How were you able to narrow down https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-createwindowexa issues to the index-docs.js file in particular?

Syntax error in the browser console coming from that file.

Link to comment
Share on other sites

11 hours ago, Bruninho said:

Hahaha!

Going a bit off topic, here's what I'd rather do: 
1. https://youmightnotneedjquery.com
2. https://github.com/you-dont-need/You-Dont-Need-Javascript

As a web developer, I feel really embarrassed when people just shove jQuery and its frameworks/libraries in a page and call it a day. Things could be much simpler and more compatible with other browsers if these developers weren't so lazy. The problem lies in the fact that business need it done ASAP and they don't want to wait for us to produce a relative amount of code to overcome this when we can just throw a JS library...

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!

Link to comment
Share on other sites

I think I'm on to something.  My weekend mission is attempting to get American Water web site to work in 360Chrome v11 by using @UCyborg polyfill tricks.

American Water serves 14 million people spanning 46 US States - https://en.wikipedia.org/wiki/American_Water_Works

Total US population is 332.4 million so directly affecting 14 million might not sound like much, especially since I can only assume that most pay their bill via PHONE and not "web brower" via desktop or laptop computer.

 

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...