[Suggestion] Remove obsolete "contains" methods
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.
This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.
Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.
This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.
Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
-
- Moonbather
- Posts: 50
- Joined: 2021-05-30, 03:48
[Suggestion] Remove obsolete "contains" methods
Namely, I'm suggesting to remove Array.prototype.contains() and String.prototype.contains().
They are old names for Array.prototype.includes() and String.prototype.includes() respectively.
The methods have been renamed in Firefox and Chrome, and the old names have been removed, for a long time. See bug 1103588. For the record, it was due to a conflict with MooTools, which extends the prototypes…
Rationale: as a web developer, I did some development using Pale Moon, and used the old names. I didn't notice anything, as the old names just work on Pale Moon. But then I encountered errors on Chrome, etc.
As the old names don't work on mainstream browsers, I think it is useless, and may do more harm than good, to continue to support these.
They are old names for Array.prototype.includes() and String.prototype.includes() respectively.
The methods have been renamed in Firefox and Chrome, and the old names have been removed, for a long time. See bug 1103588. For the record, it was due to a conflict with MooTools, which extends the prototypes…
Rationale: as a web developer, I did some development using Pale Moon, and used the old names. I didn't notice anything, as the old names just work on Pale Moon. But then I encountered errors on Chrome, etc.
As the old names don't work on mainstream browsers, I think it is useless, and may do more harm than good, to continue to support these.
-
- Project Contributor
- Posts: 419
- Joined: 2020-02-21, 17:35
Re: [Suggestion] Remove obsolete "contains" methods
That was done in Firefox 48, Pale Moon/UXP forked at 52... not sure how they would still be in it?
-
- Add-ons Team
- Posts: 582
- Joined: 2017-01-14, 02:40
- Location: Philippines
Re: [Suggestion] Remove obsolete "contains" methods
IIRC we no longer have Array.prototype.contains(), but String.prototype.contains() was restored in 240f52db8e, for compatibility.
-
- Moonbather
- Posts: 50
- Joined: 2021-05-30, 03:48
Re: [Suggestion] Remove obsolete "contains" methods
Right, Array.prototype.contains() is already nonexistent.
About String.prototype.contains(), 7 years after Firefox 48 which removed it, I think it would now be better to remove it, as I explained in OP.
About String.prototype.contains(), 7 years after Firefox 48 which removed it, I think it would now be better to remove it, as I explained in OP.
-
- Pale Moon guru
- Posts: 35651
- Joined: 2011-08-28, 17:27
- Location: Motala, SE
Re: [Suggestion] Remove obsolete "contains" methods
Unless there is some abuse going on with it, I don't see a reason to remove this. It's a simple, straightforward alias that allows some unmaintained/archived sites to continue working, and doesn't require any maintenance.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
-
- Contributing developer
- Posts: 1537
- Joined: 2018-10-28, 19:56
- Location: Georgia
Re: [Suggestion] Remove obsolete "contains" methods
I don't think we should do this without some kind of underlying security reason, because I think in order to be consistent, we would have to remove all other deprecated features other browsers remove, like perhaps style scoped, etc.
The reason is precisely what you're saying... your existing code works on Pale Moon without updates, whereas it breaks on modern browsers because they ripped out an alias that was no longer needed, for no good reason. Part of the design philosophy behind Pale Moon is that we want older stuff to work on Pale Moon without breaking it for no good reason. For instance, we've kept NPAPI and the ability to use Flash player, we've kept XUL extensions, we've kept scoped styles, etc. Why would we want to get rid of an older alias for a JS function just to "force" web developers to update it for the sake of compatibility with other browsers that have gone in a direction we more or less disagree with? I just don't see much logic in that.
One concern I have is that since XUL extensions rely heavily on JS, removing JS functions for no good reason will result in XUL extensions breaking, and honestly people do not like to do the maintenance work on them. So while the older way of doing things may not be prevalent on the open web, there's a very real chance you'll encounter some ancient or unusual uses of JS within the browser's own codebase (part of which is written in JS), or within XUL extensions. While I have no problem making needed changes to match a spec to make things work, I also see no need to make busywork for extension developers by ripping things out to create an illusion of progress. Just my two cents, though... not implying it's actually up to me. LOL.
The reason is precisely what you're saying... your existing code works on Pale Moon without updates, whereas it breaks on modern browsers because they ripped out an alias that was no longer needed, for no good reason. Part of the design philosophy behind Pale Moon is that we want older stuff to work on Pale Moon without breaking it for no good reason. For instance, we've kept NPAPI and the ability to use Flash player, we've kept XUL extensions, we've kept scoped styles, etc. Why would we want to get rid of an older alias for a JS function just to "force" web developers to update it for the sake of compatibility with other browsers that have gone in a direction we more or less disagree with? I just don't see much logic in that.
One concern I have is that since XUL extensions rely heavily on JS, removing JS functions for no good reason will result in XUL extensions breaking, and honestly people do not like to do the maintenance work on them. So while the older way of doing things may not be prevalent on the open web, there's a very real chance you'll encounter some ancient or unusual uses of JS within the browser's own codebase (part of which is written in JS), or within XUL extensions. While I have no problem making needed changes to match a spec to make things work, I also see no need to make busywork for extension developers by ripping things out to create an illusion of progress. Just my two cents, though... not implying it's actually up to me. LOL.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind
-
- Pale Moon guru
- Posts: 35651
- Joined: 2011-08-28, 17:27
- Location: Motala, SE
Re: [Suggestion] Remove obsolete "contains" methods
Out of curiosity I did a quick search in the archive I have of XUL extensions (similar to what's on CAA) and found that around 70 or so have ".contains(" somewhere in their code, including popular ones like vimfx, tree style tabs and firegestures. So yes, those would likely break by removing support for this alias. And that won't actually count ones that use contains in a different calling format not exactly "something.contains(string)" on a single line...athenian200 wrote: ↑2023-10-04, 12:26One concern I have is that since XUL extensions rely heavily on JS, removing JS functions for no good reason will result in XUL extensions breaking
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
-
- Keeps coming back
- Posts: 940
- Joined: 2021-01-26, 11:18
Re: [Suggestion] Remove obsolete "contains" methods
If you also didn't remove support for Windows XP, that would be great...
-
- Pale Moon guru
- Posts: 35651
- Joined: 2011-08-28, 17:27
- Location: Motala, SE
Re: [Suggestion] Remove obsolete "contains" methods
Are you sure you want to keep beating that horse carcass?
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
-
- Keeps coming back
- Posts: 940
- Joined: 2021-01-26, 11:18
Re: [Suggestion] Remove obsolete "contains" methods
Now that the job has already been done, it probably doesn’t make sense to go back... However, many people are forced to switch from Windows XP to new systems precisely because there is no modern browser for XP. It’s not at all because XP is outdated or there is no support or the system doesn’t work well. Just recently I witnessed two such cases. But Windows 10 on the same hardware works very slowly, and everything needs to be updated along the chain. And this is just for the sake of the browser...
-
- Project Contributor
- Posts: 204
- Joined: 2020-03-02, 16:04
Re: [Suggestion] Remove obsolete "contains" methods
Off-topic:
Windows 7 is the answer. It works wery well even on budget end of 00 hardware(Athlon II x3 in my case), it is immensely more robust, stable and secure than XP. I had to reinstall XP many times in span of two years back then because of viruses and performance issues(it for some reason got slow and sluggish over time), but 7 once installed endures to this day good as new(and that with less experienced users from mid 2014).
I honestly can't see how PC that can't run 7 well will be even remotely usable with modern websites in their sorry state.
Also that end of 00 hardware(or even sightly newer) is dirt cheap to get nowdays.
Windows 7 is the answer. It works wery well even on budget end of 00 hardware(Athlon II x3 in my case), it is immensely more robust, stable and secure than XP. I had to reinstall XP many times in span of two years back then because of viruses and performance issues(it for some reason got slow and sluggish over time), but 7 once installed endures to this day good as new(and that with less experienced users from mid 2014).
I honestly can't see how PC that can't run 7 well will be even remotely usable with modern websites in their sorry state.
Also that end of 00 hardware(or even sightly newer) is dirt cheap to get nowdays.
-
- Keeps coming back
- Posts: 940
- Joined: 2021-01-26, 11:18
Re: [Suggestion] Remove obsolete "contains" methods
Off-topic:
Yes, Windows 7 can still be bought, but it is also outdated and not so cheap. Since the operating system has to be changed, people do not want to spend money on replacing one outdated system with another. They would be quite happy with XP with a modern browser, but if that’s not possible, then they’ll update everything.
-
- Pale Moon guru
- Posts: 35651
- Joined: 2011-08-28, 17:27
- Location: Motala, SE
Re: [Suggestion] Remove obsolete "contains" methods
Off-topic:
I think if you're going to use an outdated system, use the best outdated OS you can. Otherwise, you have to buy a new computer for a new OS. And a Win 7 key is, what, $10 for Pro? Definitely cheaper than buying a new PC
The bottom line for XP is a simple one: NT5 is the problem. Win7 up to Win 11 is all based on the same kernel and OS type (variants of NT6) so there is very little issue keeping support backwards to Win 7.
A case of wanting to have your cake and eat it too?
I think if you're going to use an outdated system, use the best outdated OS you can. Otherwise, you have to buy a new computer for a new OS. And a Win 7 key is, what, $10 for Pro? Definitely cheaper than buying a new PC
The bottom line for XP is a simple one: NT5 is the problem. Win7 up to Win 11 is all based on the same kernel and OS type (variants of NT6) so there is very little issue keeping support backwards to Win 7.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
-
- Keeps coming back
- Posts: 940
- Joined: 2021-01-26, 11:18
Re: [Suggestion] Remove obsolete "contains" methods
Off-topic:
No, that's not the case for me. I use what I'm used to as long as it suits me. I skipped Windows Vista and Windows 7 and went straight from XP to a new computer with 8.1 and then 10.
This is OEM. Although it will work, the license is violated, as far as I understand.
It's clear. But it's a pity. Although this doesn't concern me... personally I don't need XP support.
-
- Moonbather
- Posts: 50
- Joined: 2021-05-30, 03:48
Re: [Suggestion] Remove obsolete "contains" methods
Some (or even most) of them may be false positives. I had done similar searches on some codebases, and all results were actually classList.contains() (most of the occurrences), or Node.contains(), MooTools methods (String:contains, Array:contains, Object:contains…), or even user-defined methods.Moonchild wrote: ↑2023-10-04, 16:00Out of curiosity I did a quick search in the archive I have of XUL extensions (similar to what's on CAA) and found that around 70 or so have ".contains(" somewhere in their code, including popular ones like vimfx, tree style tabs and firegestures. So yes, those would likely break by removing support for this alias. And that won't actually count ones that use contains in a different calling format not exactly "something.contains(string)" on a single line...
-
- Lunatic
- Posts: 323
- Joined: 2022-03-23, 16:41
- Location: Chamber of Secrets
Re: [Suggestion] Remove obsolete "contains" methods
Off-topic:
That would lock us into old VIsual Studio versions and old C/C++ standards. It would progressively make it harder to update libraries that we build upon, and it would be harder to port changes from Mozilla Firefox. We would be doing a disservice to our users as being held back by XP support would slowly make us into an old and insecure browser like the Firefox fanboys think we are now.
That would lock us into old VIsual Studio versions and old C/C++ standards. It would progressively make it harder to update libraries that we build upon, and it would be harder to port changes from Mozilla Firefox. We would be doing a disservice to our users as being held back by XP support would slowly make us into an old and insecure browser like the Firefox fanboys think we are now.
-
- Board Warrior
- Posts: 1138
- Joined: 2019-04-24, 09:38
Re: [Suggestion] Remove obsolete "contains" methods
XP is an old-ass and insecure operating system.
Why do you still use it?
Linux exist and can run on your XP machine.
Why should the PM developers care about it and effort time in supporting it?
The profile picture shows my Maico EC30 E ceiling fan.
-
- Keeps coming back
- Posts: 940
- Joined: 2021-01-26, 11:18
Re: [Suggestion] Remove obsolete "contains" methods
XP is very fast and requires few resources compared to Windows 10. At the same time, I don’t find any fundamental innovations in Windows 10 that justify its bulkiness. If it were not for some circumstances, such as the lack of a modern browser, I would choose a more efficient system, and it does not matter to me whether it is older or newer.Pentium4User wrote: ↑2023-10-18, 08:26XP is an old-ass and insecure operating system.
Why do you still use it?
-
- Moon Magic practitioner
- Posts: 2411
- Joined: 2012-08-19, 20:32
Re: [Suggestion] Remove obsolete "contains" methods
I think the main problem with XP is security (or lack thereof).
Safe Mode / clean profile info: Help/Restart in Safe Mode
Information to include when asking for support - How to apply user agent overrides
How to auto-fill passwords
Windows 10 Pro x64
Information to include when asking for support - How to apply user agent overrides
How to auto-fill passwords
Windows 10 Pro x64
-
- Fanatic
- Posts: 208
- Joined: 2016-10-11, 11:36
Re: [Suggestion] Remove obsolete "contains" methods
life is neither safe or secureback2themoon wrote: ↑2023-10-18, 18:28I think the main problem with XP is security (or lack thereof).
There are many use cases, browsing on an intranet, using sandboxes, virtualization, firewalls,... there where risks tend to 0 or just exposure has 0 impact on the user.
IMO. well informed users should have the power to decide what they want and how to use, and at the moment there are some unofficial forks focused on XP with a bunch of users