BrowserWorks / Waterfox-Classic

The Waterfox Classic repository, for legacy systems and customisation.
https://classic.waterfox.net
Mozilla Public License 2.0
176 stars 33 forks source link

JS: Optional chaining operator "?." support #35

Open IS4Code opened 2 years ago

IS4Code commented 2 years ago

Recently StackExchange seems to have started using the ?. operator in its code, apparently breaking the whole site. What are the possibilities for enabling this operator?

hawkeye116477 commented 2 years ago

See https://repo.palemoon.org/mcp-graveyard/UXP/issues/1658. You'd need to provide Pull Request with implementation of it.

But this is not the biggest worry, there are a lot of potential security issues in Classic. Unfortunately it lacks good support, volunteers to continue proper maintaining it. For few months I was the only external contributor, but it's too much for one person.

reallyuniquename commented 2 years ago

@hawkeye116477

there are a lot of potential security issues in Classic

How bad is it? I know about the wiki page but I'd appreciate a general assessment. Are we looking at remote code execution right now?

buc-me commented 2 years ago

If someone is still interested in this, it seems that I've backport nullish-coalesce and optional-chaining to SeaMonkey-2.53.10, which I maintain at Fedora Linux downstream level. It was done over the backport of new-regexp from here (btw, VERY THANKS for this), so it's likely that this stuff can be applied to Waterfox-Classic code without too much effort.

See "nullish-coalesce" and "optchain" patches at https://src.fedoraproject.org/rpms/seamonkey/tree/39f13400 . (Note, the patches will be slightly changed for future SM releases due to rebasing, so use the ones for SM vesrion of 2.53.10, which are the first and should be closest to the WF-Classic anyway.)

Not related to the official upstream (they have an alternate plan for these features -- ie. will appear as a result of a gradual backport from Firefox code tree).

Do not ask how and why it was done. Sometimes you start walking forward, stop several times, then you feel sorry for the distance already traveled and you take the next step, and so on. It was done at random, and it looks like we got lucky this time.

There was no specific "correct" plan, there was no any "strong" testing. There just isn't time for all that. Tested only on some sites (most complained about by users). Feel free to do more. Just imagine that someone cut a path in the jungle. It's not an autobahn, and maybe not even a road at all, but it's better than nothing... :)

Fedora is rpm-based distribution, so the build instructions are in .spec file (as usual). Some hints are in the header of optchain-1566143-3.patch, no time to write more. Will work without the last optchain-baselinejit.patch too (correspond scripts will just remain uncompiled), but better is with (just not tested anywhere yet).

rychphd commented 2 years ago

I'm interested in this fix, please, or at least to know if it's not going to happen

The issue is also described in https://meta.stackexchange.com/questions/376694/stack-exchange-changes-broke-ui-on-multiple-legacy-browsers-again

buttercookie42 commented 2 years ago

It looks like I've successfully managed to apply @buc-me's patches, big thanks to him for his work. WIP patches are here, but because they depend on some changes backported as part of nullish coalescing (which due to my local build is in turn stuck on PGO support/#104) and because Github doesn't support stacked pull request, I can't put up a pull request yet.

Sa-Ja-Di commented 2 years ago

https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1901

Nullish Coalescing was successfully implemented in Pale Moon and can be revisited for Waterfox Classic too!