input type="file", the "files" property is now read-write

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
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.
vannilla
Moon Magic practitioner
Moon Magic practitioner
Posts: 2194
Joined: 2018-05-05, 13:29

input type="file", the "files" property is now read-write

Unread post by vannilla » 2024-01-15, 08:55

I'm not sure when it changed, but in other browsers the files property of the HTMLInputElement object can be assigned to if you pass a DataTransfer instance.
The living standard actually says that user agents can make it not mutable but Pale Moon is the only browser doing so, if we do not count old versions of Safari (before 14, released in 2020).

I found this out because I was asked to implement a drag-and-drop thingamajig and for a number of reasons I cannot use the trick other systems employ where the file is uploaded in the background and what's passed around is an ID, so all I could do was trying to change the actual input element. So far only Pale Moon "breaks" it.

It's fine if it's kept not mutable if there is not a desire to change it, but since I happened to stumble upon it I thought I'd share.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35650
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: input type="file", the "files" property is now read-write

Unread post by Moonchild » 2024-01-15, 19:03

I think this is a fair enough request. I'll file an issue on the repo.

EDIT: Issue #2458 (UXP)
"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

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35650
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: input type="file", the "files" property is now read-write

Unread post by Moonchild » 2024-01-15, 19:26

Painless for a change. This will be in v33.0.0
"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

vannilla
Moon Magic practitioner
Moon Magic practitioner
Posts: 2194
Joined: 2018-05-05, 13:29

Re: input type="file", the "files" property is now read-write

Unread post by vannilla » 2024-01-16, 00:06

Cool, it's always great when changes are smooth. :thumbup:

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35650
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: input type="file", the "files" property is now read-write

Unread post by Moonchild » 2024-01-16, 01:06

vannilla wrote:
2024-01-16, 00:06
Cool, it's always great when changes are smooth. :thumbup:
It is! I wish it happened more often.
"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