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.
-
Moonchild
- Pale Moon guru
- Posts: 35636
- Joined: 2011-08-28, 17:27
- Location: Motala, SE
-
Contact:
Unread post
by Moonchild » 2021-06-07, 00:42
Use
FileReader.readAsText()
It has the advantage of being widely supported by all browsers and is event-based (meaning you're actually using the native paradigm for JS) as well as being able to use encodings other than UTF-8 if necessary.
"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
-
Lurker_01
- Fanatic
- Posts: 122
- Joined: 2015-06-12, 14:59
- Location: Uruguay
Unread post
by Lurker_01 » 2021-06-07, 01:09
Lurker_01 wrote: ↑2021-06-06, 23:47
While it is possible to use a file reader as an alternative...
Like i said, yes this is a workaround. i was talking with the game developers and said that this API is a Working draft, and that they could use File Reader instead of this shortcut but they treated it as a "browser bug".
This is outside of my control and i am just reporting a problem.
-
Moonchild
- Pale Moon guru
- Posts: 35636
- Joined: 2011-08-28, 17:27
- Location: Motala, SE
-
Contact:
Unread post
by Moonchild » 2021-06-07, 01:24
Well we can't do anything about something that isn't a browser bug, no matter if they call it that.
It's already bad enough that we have to implement working draft specs to begin with, let alone ones that have well-supported alternatives that do the exact same thing. The only thing they'd have to do is use the event handler for loaded state instead of a promise (and they can even wrap it in a promise in JS too if they have some aversion to using it as-is, shimming the API).
So the solution is simple: they can either use a broadly-supported API instead of their draft shiny, or lose players.
"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