Internet Archive enables Ruffle on SWF pages

General project discussion.
Use this as a last resort if your topic does not fit in any of the other boards but it still on-topic.
Forum rules
This General Discussion board is meant for topics that are still relevant to Pale Moon, web browsers, browser tech, UXP applications, and related, but don't have a more fitting board available.

Please stick to the relevance of this forum here, which focuses on everything around the Pale Moon project and its user community. "Random" subjects don't belong here, and should be posted in the Off-Topic board.
User avatar
Mæstro
Astronaut
Astronaut
Posts: 509
Joined: 2019-08-13, 00:30
Location: Casumia

Internet Archive enables Ruffle on SWF pages

Unread post by Mæstro » 2024-05-13, 13:46

One could regard this as a sequel to the resolved matter wherein the Archive would automatically substitute Ruffle on websites. The problem seems separately to occur when one accesses in the Archive pages ending in .swf. The measure described in the other thread simply causes the page to appear blank. How can I disable Ruffle on these pages also, so I can play normally?
Browser: Pale Moon (official build, updated regularly)
Operating System: Linux Mint Debian Edition 4 (amd64)
※Receiving Debian 10 ELTS security upgrades
Hardware: HP Pavilion DV6-7010 (1400 MHz, 6 GB)
Ash is the best letter.

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

Re: Internet Archive enables Ruffle on SWF pages

Unread post by Moonchild » 2024-05-13, 13:51

I think you'll have to ask archive.org to allow standard plugin embedding in that case; they are literally replacing the swf with a web page so there won't be an easy way to directly get the swf at the source of it then.
"A dead end street is a place to turn around and go into a new direction" - Anonymous
"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
Mæstro
Astronaut
Astronaut
Posts: 509
Joined: 2019-08-13, 00:30
Location: Casumia

Re: Internet Archive enables Ruffle on SWF pages

Unread post by Mæstro » 2024-05-13, 21:17

In fact, there is an easy way. Credit is again to my sister for discovering how: a regular expression in URL Redirector, including https://web.archive.org/web/(.*)if_/(.*).swf(.*) and redirecting to https://web.archive.org/web/$1oe_/$2.swf$3. This complements the measures in the original post to restore SWF function. I will add this to the relevant tutorial.
Browser: Pale Moon (official build, updated regularly)
Operating System: Linux Mint Debian Edition 4 (amd64)
※Receiving Debian 10 ELTS security upgrades
Hardware: HP Pavilion DV6-7010 (1400 MHz, 6 GB)
Ash is the best letter.

User avatar
craniumcadoo
Moonbather
Moonbather
Posts: 61
Joined: 2023-08-02, 19:42

Re: Internet Archive enables Ruffle on SWF pages

Unread post by craniumcadoo » 2024-05-28, 17:44

Fun fact, Ruffle works on Pale Moon nowadays. The problem is the Internet Archive uses an outdated version of Ruffle from before https://github.com/ruffle-rs/ruffle/pull/15377.

Still, it would be better if this page didn't use Ruffle on Flash-enabled browsers. I'd think https://github.com/ruffle-rs/ruffle/pull/11407 would have covered that, but the Internet Archive does some very funky stuff to make itself work with Ruffle, so something they're doing must affect this.

User avatar
craniumcadoo
Moonbather
Moonbather
Posts: 61
Joined: 2023-08-02, 19:42

Re: Internet Archive enables Ruffle on SWF pages

Unread post by craniumcadoo » 2024-05-28, 17:50

I'd think https://github.com/ruffle-rs/ruffle/pull/11407 would have covered that, but the Internet Archive does some very funky stuff to make itself work with Ruffle, so something they're doing must affect this.
Ah, it's a very simple reason. They replace the SWF with a page that uses the Ruffle API. That PR only affected polyfill usages of Ruffle. If you use the API, Ruffle ignores Flash support for obvious reasons. It would technically be possible for Ruffle to create a normal embed when the API is used on a browser with Flash support, but it's generally been considered not worth the effort, as if you use the Ruffle API it's assumed you want to use Ruffle itself.

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

Re: Internet Archive enables Ruffle on SWF pages

Unread post by Moonchild » 2024-05-28, 18:24

craniumcadoo wrote:
2024-05-28, 17:50
but it's generally been considered not worth the effort, as if you use the Ruffle API it's assumed you want to use Ruffle itself.
It's ultimately because they want people to use their tech and not what they are trying to emulate. Never mind that Ruffle is incomplete.
"A dead end street is a place to turn around and go into a new direction" - Anonymous
"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
craniumcadoo
Moonbather
Moonbather
Posts: 61
Joined: 2023-08-02, 19:42

Re: Internet Archive enables Ruffle on SWF pages

Unread post by craniumcadoo » 2024-05-29, 18:31

It's ultimately because they want people to use their tech and not what they are trying to emulate.
Well I opened https://github.com/ruffle-rs/ruffle/pull/16523 to fix this. We'll see what the general opinion is on it. It admittedly is a bit awkward to add that much code just to do something under these circumstances:

Code: Select all

this.loadedConfig.favorFlash && isFlashEnabledBrowser() && "url" in options
The this.loadedConfig.favorFlash ensures that there is a way for a developer who wants to specifically use Ruffle to use it even in browsers with Flash support (I have spoken with a few developers in the Ruffle Discord server who have stated that their new games are faster with Ruffle because they used more of the things Ruffle handles better than Flash and less of the things Flash handles better than Ruffle when designing those new games).

The Ruffle API has two ways to load Flash content with the load function, by url or by data stream. There's no equivalent for Flash Player to loading by data stream, so if that's the option you use in the API, Ruffle has to use its own emulator.

isFlashEnabledBrowser() is the same function used to stop the polyfill on Flash-enabled browsers. It checks this, and on a Linux browser with Flash such as Pale Moon this returns true since libflashplayer.so !== "ruffle.js":

Code: Select all

(navigator.plugins.namedItem("Shockwave Flash")?.filename ??
            "ruffle.js") !== "ruffle.js"

User avatar
craniumcadoo
Moonbather
Moonbather
Posts: 61
Joined: 2023-08-02, 19:42

Re: Internet Archive enables Ruffle on SWF pages

Unread post by craniumcadoo » 2024-05-29, 18:33

Code: Select all

Never mind that Ruffle is incomplete.
You're welcome to contribute. It's very hard to emulate Flash using just modern web APIs without access to NPAPI, so imo it's amazing how far Ruffle has already come.

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

Re: Internet Archive enables Ruffle on SWF pages

Unread post by Moonchild » 2024-05-30, 01:10

craniumcadoo wrote:
2024-05-29, 18:33
You're welcome to contribute. It's very hard to emulate Flash using just modern web APIs
I''m sorry but I have no interest in contributing to it. It's only necessary because the powers that be unilaterally decided to short a huge flash community instead of keeping native binary plugin support. My support for the Flash community is there in maintaining NPAPI plugins in UXP/Pale Moon. The modern Web APIs have their limits. However, as far as I understood this has more to do with actionscript than with using Web APIs, so I'm not even sure what your point is here.
"A dead end street is a place to turn around and go into a new direction" - Anonymous
"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
craniumcadoo
Moonbather
Moonbather
Posts: 61
Joined: 2023-08-02, 19:42

Re: Internet Archive enables Ruffle on SWF pages

Unread post by craniumcadoo » 2024-05-30, 05:00

as far as I understood this has more to do with actionscript than with using Web APIs
It's a few things really. One is that it's hard to reverse-engineer Flash to make sure everything works properly and the official documentation lies frequently and the closest we have to source code to analyze is avmplus which is not a complete implementation detail. The source code for Flash has probably leaked but using that would get us in legal trouble. But another issue is reimplementing everything in Rust with backend code to handle functionality as identically as possible on desktop on Windows, Mac, and Linux, web with WebAssembly, and even the new Android backend.

A few issues encountered due to needing to support web are XMLSocket support, which on desktop we can and do support automatically but since browsers don't allow direct socket connection to support this on web we need to ask webmasters to configure a WebSocket proxy using something like websockify to support (https://github.com/ruffle-rs/ruffle/wik ... om-the-web), supporting system fonts, which on desktop we can support natively but on web since the Local Font Access API was only ever implemented by desktop Chrome we need to ask webmasters to configure the page to pull fonts from a new SWF made just to embed fonts not directly embedded by the original SWF (https://github.com/ruffle-rs/ruffle/wik ... my-website), and there's another more recent issue that has been encountered and there is a recent PR and other local code changes that aim to address it: Support for H.264 video, which is still under several patents. To support that on Desktop, we are planning to use OpenH264, as seen in https://github.com/ruffle-rs/ruffle/pull/14654, while on web there is a plan to support it with the brand new VideoDecoder API using WebCodecs, but since that's unsupported on Firefox (for now) and on http pages, there is a plan to fallback to a hack with video and canvas elements (that plan is to remux NALU to fMP4, attach the MediaSource to a <video>, draw that <video> onto a <canvas>, capture that <canvas> into imageData, and copy the data out of the image)
Last edited by craniumcadoo on 2024-05-30, 11:56, edited 2 times in total.

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 5549
Joined: 2015-12-09, 15:45

Re: Internet Archive enables Ruffle on SWF pages

Unread post by moonbat » 2024-05-30, 05:35

craniumcadoo, use the quote button, not the code block one when quoting someone. It's the 4th button from the left in the post editor.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
KDE Neon on a Slimbook Excalibur (Ryzen 7 8845HS, 64 GB RAM)
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

User avatar
craniumcadoo
Moonbather
Moonbather
Posts: 61
Joined: 2023-08-02, 19:42

Re: Internet Archive enables Ruffle on SWF pages

Unread post by craniumcadoo » 2024-05-31, 23:22

Things seem to be leaning towards not landing this PR. I can't say I necessarily disagree. The Ruffle API already has a few bits of functionality that differ from Flash. For example, you can do

Code: Select all

player.volume = 0.5;
to set the volume of the SWF to half its initial value (on a logarithmic scale akin to human hearing). Another example is that when Ruffle is done loading an SWF it fires the loadeddata event, and some webmasters therefore wait for that event before doing something else. Additionally, there are plans to version the API and add even more QOL functionality that did not exist for Flash Player. If we fell back to a Flash embed some of a webmaster's code may not do anything if they used the API for functionality that didn't exist in Flash. Also, there is a Ruffle configuration option, playerRuntime, which when set to "air" is meant to allow you to embed an AIR SWF in the browser (even on mobile browsers, since Ruffle uses technologies that work on mobile). Currently, Ruffle still doesn't support most AIR APIs, but there are plans to improve that support, and if someone used the Ruffle API to load an AIR swf in the future, even Flash-enabled browsers wouldn't be able to load it without Ruffle.

Instead, we should just emphasize that webmasters should use the embed/object elements with the polyfill if their only purpose in using Ruffle is to embed Flash, which we already mention as the preferred method for non-advanced users. The same applies here. Nothing the Internet Archive does here required the use of the API, but for some reason they used it, and this is just the unfortunate result.

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

Re: Internet Archive enables Ruffle on SWF pages

Unread post by Moonchild » 2024-06-01, 12:45

craniumcadoo wrote:
2024-05-31, 23:22
Nothing the Internet Archive does here required the use of the API, but for some reason they used it, and this is just the unfortunate result.
Unfortunately it is also true that most people consume flash content through the internet archive. So, as I said before, the internet archive should allow NPAPI plugin use. I'm not really sure who is in the best position to convince them of this.
"A dead end street is a place to turn around and go into a new direction" - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite