|Benefits for LWN subscribers|
The primary benefit from subscribing to LWN is helping to keep us publishing, but, beyond that, subscribers get immediate access to all site content and access to a number of extra site features. Please sign up today!
Mozilla certainly has valid reasons for pursuing a project like Shumway: no matter how much people claim that they hate Flash, there remains a lot of Flash content on the web, and several of Mozilla's target platforms will soon have no official Flash implementation. For starters, Adobe announced its intention to drop Linux support from its traditional Netscape Plugin API (NPAPI) plugin. Google, however, is pressing forward with its own Flash support for Chrome on Linux, which would leave Firefox with a noticeable feature gap by comparison.
Then, too, there is the mobile device sector to consider: Adobe dropped Flash for mobile browsers in 2011, and so far Google's Chrome team says it has no plans to implement support for the format on Android. If Mozilla were able to deliver reasonable performance in a plugin-less Flash VM for the Android builds of Firefox, then there would certainly be an interested audience. There are already third-party browsers for Android that do support Flash, and some users are evidently willing to jump through hoops to install the old, 2011-era plugin on today's Android releases.
But regardless of whether or not Flash support is vital to any person's web browsing experience, Shumway being made available in Firefox itself is news in its own right. Previously, the Shumway VM was installable as a Firefox extension [XPI], although interested users could also see an online demo of the code running in a test page. The Shumway code was merged on October 1. Builds are available from the Firefox Nightly channel; if all goes according to schedule, the feature will arrive for the general public in Firefox 27 in January 2014.
In order to test the nightly build's Shumway implementation, users must open about:config and change the shumway.disabled preference to false. With Shumway activated, users can test drive Flash-enabled sites or open SWF files. There are five demos linked to at the project's "Are we Flash yet?" page, although the links actually attempt to open the files in the "Shumway Inspector" debugging tool—which, in my tests, reports all of the files as corrupt and renders none of them.
It is straightforward enough to download the files from the examples directory of the Shumway GitHub repository and open them directly, however. The "pac" demos are a simple Pac-Man character that can be navigated with the keyboard arrow keys; pac.swf is implemented in ActionScript 2 (Flash's scripting language) and pac3.swf in ActionScript 3. The "racing" demos are an animated car-racing video game (again available for both ActionScript 2 and 3); there is also an MP3 player demo and a 2D falling-boxes demo that shows off a simple physics engine. Together, these and the other demos in the Shumway GitHub repository demonstrate basic interactivity, media playback, and vector graphics.
That said, Shumway is currently considerably slower than the other two projects. In the Firefox nightly, it runs its own demos, but does not even run them at anything approaching a usable speed (for instance, there is significant lag between key presses in the racing game and actual movement on screen).
Performance aside, the other important factor in replacing Adobe's binary Flash plugin is correctness—whether or not Shumway can render arbitrary Flash content found in the wild in a usable fashion. This is a tricky question, the answer to which varies considerably based on each individual experiment. I tested Shumway against a random assortment of free Flash games, several business web sites, and an interactive house-painting visualizer from a home-improvement store (don't ask...). To my surprise, Shumway had no trouble with the home-improvement app and played most of the games, albeit slowly enough to prevent me from becoming competitive, and with occasional visual artifacts. YouTube, however, did not work—which might also be attributable to other issues, such as the video codecs used. The canonical response to that is that YouTube is best used in HTML5 <video> mode, of course, putting it outside of Shumway's purview entirely.
The project has made considerable progress since we last looked at it in 2012, but there is also a lot of work remaining. For starters, despite Adobe's periodic insistence that the Flash specification is open, there are evidently a significant number of undocumented APIs. Flash is also, to put it mildly, a large and complex format that incorporates a lot of (literally) moving parts; the testing process would be long under even the best circumstances. But the same argument could be made for PDF, which Firefox has been interpreting with a built-in viewer since Firefox 19. That project, too, started off as an in-house experiment at Mozilla Labs (which does not appear to be synonymous with Mozilla Research).
Perhaps the success of PDF.js bodes well for the future of Shumway—after all, a full year after Shumway's initial debut, the world does not seem to be any closer to reaching the much-ballyhooed end of the Flash era. Then again, if Flash files can be rendered into normal web content without a buggy, proprietary plugin, perhaps its continued existence is not that big of a problem.
Copyright © 2013, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds