User: Password:
|
|
Subscribe / Log in / New account

Shumway lands in Firefox

LWN.net needs you!

Without subscribers, LWN would simply not exist. Please consider signing up for a subscription and helping to keep LWN publishing

By Nathan Willis
October 7, 2013

Mozilla has merged the code for Shumway, its JavaScript-based Flash runtime, into the latest builds of Firefox. The feature must be switched on manually, but it still marks a milestone for a project that Mozilla initially described as an R&D venture. Shumway is still a work in progress, but it brings Firefox users one step closer to eliminating a plugin that few will miss.

We first looked at Shumway in November 2012, shortly after it first went public. The goal of the project has always been to implement a "web-native" runtime for Flash—that is, a virtual machine to run Shockwave/Flash (SWF) files not through a browser plugin, but by translating SWF content into standard HTML, CSS, and JavaScript. In 2012, Shumway was an effort branded with the "Mozilla Research" moniker (though whether that designation makes it an official project or a personal investigation is not clear), and the initial announcement came with the caveat that Shumway was "very experimental." The project's GitHub README still says that "integration with Firefox is a possibility if the experiment proves successful," although it now seems that Mozilla is moving forward from the research stage to testing in the wild.

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.

[The box demo in Shumway]

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.

It can also be instructive to open up some of the SWF demos and tests from the other free software Flash players Gnash and Lightspark. Shumway is a more ambitious project in some respects than either Lightspark or Gnash, in that it targets support for both ActionScript 2 and ActionScript 3. Adobe introduced ActionScript 3 with Flash 9, and with it incorporated a new virtual machine model. Neither of the other free software projects has had the time or the resources to tackle both; Gnash implements the older standard and Lightspark the newer. Shumway's ActionScript support is built in to the Tamarin engine that is also used as Firefox's JavaScript interpreter. The non-ActionScript contents of a Flash file are parsed by Shumway and translated to standard HTML5 elements.

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 racing demo in Shumway]

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.


(Log in to post comments)

Shumway lands in Firefox

Posted Oct 8, 2013 7:50 UTC (Tue) by renox (subscriber, #23785) [Link]

> Perhaps the success of PDF.js bodes well for the future of Shumway

The "success" of PDF.js??
You mean the thing that I disabled as soon as it was enabled by default because its rendering of PDFs was ugly?
I wouldn't call this a success..

IMHO they made a big mistake enabling it by default before it was ready, because even if PDF.js has improved I wouldn't know: I have no real incentive to retry it..

Shumway lands in Firefox

Posted Oct 8, 2013 8:28 UTC (Tue) by Aissen (guest, #59976) [Link]

PDF.js works very well for me, and despite its slowness on mobile, I've found it more than sufficient for all PDFs. It replaces plugins very well.

In fact, I'm now annoyed when I have to use gmail, because they don't allow previewing attached pdf files in PDF.js, but they force the use of Google Docs preview on us. Of course, Chrome is allowed to use its own pdf plugin…

PDF.js is IMO one of the best innovations that shipped in Firefox in the recent years.

Shumway lands in Firefox

Posted Oct 8, 2013 9:15 UTC (Tue) by rvfh (subscriber, #31018) [Link]

YMMV. I just love that stuff. It renders broken PDF files that Adobe Reader fails to open on my Android Phone!!!

Shumway lands in Firefox

Posted Oct 8, 2013 9:20 UTC (Tue) by ovitters (subscriber, #27950) [Link]

It may be a little bit slow, but better to have most Firefox users have this + Flash replacement than the originals as those are very insecure.

Shumway lands in Firefox

Posted Oct 8, 2013 10:08 UTC (Tue) by dlang (subscriber, #313) [Link]

who used flash to view pdf files?

I'm much happier with pdf files being handled by my choice of pdf readers already on the system rather than having them sqeezed into the body portion of a browser window (causing the loss of space due to still having browser-related menues that aren't relevant to pdfs as well as the pdf related menus)

now, Shumway may be a different story, if it provides good compatibility that has been missing from the current flash options.

besides, they need to do something now that Adobe has stopped supporting Flash on firefox.

Shumway lands in Firefox

Posted Oct 8, 2013 13:13 UTC (Tue) by ovitters (subscriber, #27950) [Link]

I never suggested that Flash was used to read PDF files. Firefox however does this. On Windows, Acrobat will have a plugin which shows you any PDF in the browser window. So PDF.js makes little difference.

For Firefox it IMO makes huge sense to offer something secure. Loads of issues with Java, PDF files and Flash. They block insecure old versions, but that only blocks the known security issues. They're also working on sandboxing. Really appreciate all the work going on at the same time to make the browser more secure.

Shumway lands in Firefox

Posted Oct 8, 2013 14:09 UTC (Tue) by ovitters (subscriber, #27950) [Link]

I mean Firefox reads PDF files using PDF.js, not using Flash :P

Realized that this might be a bit unclear.

Shumway lands in Firefox

Posted Oct 8, 2013 11:37 UTC (Tue) by cesarb (subscriber, #6266) [Link]

I also disabled it initially at home, but left it enabled at work. After some time, I ended up enabling it again at home. It is very convenient to be able to simply open a PDF on a new tab, almost as if it was a normal HTML page; it renders most PDFs well enough, and for the few in which it misbehaves, I can always use a button in the corner to send the file to the native PDF viewer (evince or okular).

Shumway would be even more useful, since I do not have a native Flash viewer on any of my machines (I gave up on Gnash and Lightspark some time ago). But I fear that a built-in Flash viewer will only bring us back to the bad times more than a decade ago where many sites used Flash for their navigation, with no HTML fallback.

Shumway lands in Firefox

Posted Oct 8, 2013 16:04 UTC (Tue) by dashesy (guest, #74652) [Link]

I used to always disable plugins to open pdf files in the browser (not trusting Adobe with regard to security did not want to hit an infected pdf with cross-site exploits), but PDF.js works fine, is as secure and JS engine, and is getting better, it rarely leaves funny artifacts on screen when smooth-scrolling, nor triggers OOM for a pdf file open for a week. If it was not used by default, probably those bugs could be left unnoticed. I particularly like to use the same search, zoom and navigation features I have for the rest of web.

Shumway lands in Firefox

Posted Oct 8, 2013 19:05 UTC (Tue) by _xhr_ (subscriber, #92665) [Link]

PDF.js is one of the great inventions in browser land. No need for fat and ugly browser plugins, just an embedded JavaScript app.

Shumway lands in Firefox

Posted Oct 10, 2013 12:12 UTC (Thu) by wookey (subscriber, #5501) [Link]

But you didn't need a 'fat and ugly' plugin - just have PDF files dealt with by your PDF viewer - which works beautifully, and has for years. I don't understand why people want PDFs loaded in their browser window, rather than one of many apps designed for the purpose.

I turned PDF.js off imediately as it was just as annoying as things like scribd and other 'online PDF services' where you don't get the file to view as you see fit, you get a web-interface to the file, which at best is gratuitously different, and is often vile (animated page turns) and/or broken (you can see the page turns, but not the actual page content, for example). see luxmagazine.co.uk for an example (which at least isn't flash but is still horrid).

PDF.js is better than most of these abominations because it's consistent, and free software, but I still don't see why it's better than an external PDF viewer you can choose youself.

Shumway lands in Firefox

Posted Oct 10, 2013 14:59 UTC (Thu) by drag (subscriber, #31333) [Link]

Rarely I run into situations were PDF is required to be used inline with the html document. It requires a lot of mucking around with html code to figure out the actual pdf download.

But besides that PDFs in browsers are pretty miserable.

It really depends in your line of work and how often you run into these sorts of issues.

Shumway lands in Firefox

Posted Oct 10, 2013 23:05 UTC (Thu) by mpr22 (guest, #60784) [Link]

Firefox is a cross-platform application, and the most widely used desktop platform it supports is not delivered with a PDF viewer.

Shumway lands in Firefox

Posted Oct 11, 2013 7:40 UTC (Fri) by renox (subscriber, #23785) [Link]

> Firefox is a cross-platform application, and the most widely used desktop platform it supports is not delivered with a PDF viewer.

And Windows doesn't come with Firefox either, so your point isn't that convincing (OK I know about the Europe situation)..

Shumway lands in Firefox

Posted Oct 13, 2013 7:59 UTC (Sun) by ibukanov (subscriber, #3942) [Link]

> just have PDF files dealt with by your PDF viewer

which means that you have to trust both the browser and a PDF viewer not to infect your computer. PDF.js makes bugs in a code supporting a complex file format unexploitable.

Shumway lands in Firefox

Posted Oct 13, 2013 13:13 UTC (Sun) by cortana (subscriber, #24596) [Link]

> just have PDF files dealt with by your PDF viewer - which works beautifully

It is not beautiful for two reasons:

1. Every time I hit a PDF file in Chromium, it saves it to my Downloads folder and fires up evince. When I close evince, nothing cleans up the PDF file, so every few weeks I have to remember to trawl through the Downloads folder, cleaning out all the PDFs that have accumulated since the last cleanout.

2. Hyperlinks in PDF files are dealt with by PDF viewers inconsistently to how they are dealt with by web browsers. Imagine browsing the web without a back button--you would speculatively open *every* link in a new window, in order to avoid erasing your current position. You can't even apply that workaround to a PDF viewer, which enforces that 1 window always = 1 document.

Shumway lands in Firefox

Posted Oct 17, 2013 9:42 UTC (Thu) by engla (guest, #47454) [Link]

(1) is not a problem in Firefox, the file will be in /tmp.

The main reason to use an external PDF viewer for me (evince) is its snappiness, and that I can directly control the window size for comfortable reading regardless if it's a slide deck or a paper. Evince also has the keybindings that I've already learned, like f, w, n, p and so on.

Shumway lands in Firefox

Posted Oct 17, 2013 8:25 UTC (Thu) by Otus (subscriber, #67685) [Link]

> I don't understand why people want PDFs loaded in their browser window, rather than one of many apps designed for the purpose.

For me there are two kinds of pdfs: those that I will print and those that I wish were just simple web pages.

Shumway lands in Firefox

Posted Oct 8, 2013 19:14 UTC (Tue) by proski (subscriber, #104) [Link]

Flash is different. There is no good choice of flash players, whereas we have evince and xpdf for PDF. I can import PDF in gimp and inkscape if I need to adjust something, but what choices do I have if a flash plugin misbehaves?

It's natural for Mozilla to provide flash functionality, as flash is one of the most popular plugins and its quality is notoriously low.

Shumway lands in Firefox

Posted Oct 12, 2013 14:52 UTC (Sat) by nix (subscriber, #2304) [Link]

whereas we have evince and xpdf for PDF
Don't forget mupdf, which knocks the socks off both the above as far as I'm concerned. (Even support for JS and PDF forms, properly optional in a separate viewer binary so you can be certain it's turned off for the vast majority of PDFs).

PDF.js, Viewer.js. Was: Shumway lands in Firefox

Posted Oct 10, 2013 7:36 UTC (Thu) by ingwa (guest, #71149) [Link]

Actually PDF.js is not that bad.

And I think this would be an excellent time to plug the wonderful Viewer.js project that uses PDF.js among other things to show various types of documents. Checkout viewerjs.org for more info.

Shumway lands in Firefox

Posted Oct 10, 2013 14:17 UTC (Thu) by jschrod (subscriber, #1646) [Link]

Well written; I agree fully.

The thing that doesn't properly handle embedded fonts with Non-ASCII characters, making forms and other important information rendered badly.

Shumway lands in Firefox

Posted Oct 17, 2013 21:24 UTC (Thu) by scientes (guest, #83068) [Link]

PDF.js works great, I only disable it because it is slow compared to muPDF and other native pdf readers (although MUCH faster than the official PDF reader)

Shumway lands in Firefox

Posted Oct 8, 2013 8:51 UTC (Tue) by djc (subscriber, #56880) [Link]

> Shumway's ActionScript support is built in to the Tamarin engine that is also used as Firefox's JavaScript interpreter. The non-ActionScript contents of a Flash file are parsed by Shumway and translated to standard HTML5 elements.

That seems wrong. I'm pretty sure Tamarin never ended up being an actual part of Firefox's JavaScript interpreter (colloquially known as SpiderMonkey). I even think nanojit is no longer used for SpiderMonkey's JITs.

Shumway lands in Firefox

Posted Oct 8, 2013 19:46 UTC (Tue) by graydon (guest, #5009) [Link]

Yeah, Tamarin never landed and Nanojit is gone. There are no pieces of that stuff left as far as I know.

Shumway lands in Firefox

Posted Oct 8, 2013 14:14 UTC (Tue) by ceplm (subscriber, #41334) [Link]

Everybody is crazy about games, but the most important Flash thing everybody ignores. http://weebls-stuff.com/flash/5873badgerf9.swf works! (http://mcepl.fedorapeople.org/tmp/badgerbadger.webm)

Shumway lands in Firefox

Posted Oct 8, 2013 19:51 UTC (Tue) by lkundrak (subscriber, #43452) [Link]

QWOP does not, though :(

Shumway lands in Firefox

Posted Oct 8, 2013 23:18 UTC (Tue) by krakensden (subscriber, #72039) [Link]

Any news on Joe Cartoon?

Shumway lands in Firefox

Posted Oct 9, 2013 18:15 UTC (Wed) by jengelh (subscriber, #33263) [Link]

>Everybody is crazy about games, but the most important Flash thing everybody ignores.

Which shows that not everybody is high on *web* games.

And in the mobile space, there is an app for it all. (For _every_ little thing in fact, because apparently, producing a mobile-suitable HTML5 implementations of what-have-you is too complicated or something.)

Shumway lands in Firefox

Posted Oct 10, 2013 15:33 UTC (Thu) by iabervon (subscriber, #722) [Link]

If your web site just works perfectly on mobile, you still have the problem that it's not in the app store, so mobile users don't think it exists. And, furthermore, they can't install it and be able to use it without interfering with the state of their browser app. So you end up with the problem that you can't find the weather because you're watching a YouTube video in something that the task manager can't distinguish from your weather viewer. Of course, there's no good reason mobile couldn't have HTML5 as a package format, executed with a chunk of a browser that doesn't let you leave the page and reports itself as being the page rather than being the browser. But that's a platform decision, rather than an app-development decision, and the major mobile platforms haven't gone that way yet.

Shumway lands in Firefox

Posted Oct 10, 2013 16:38 UTC (Thu) by jengelh (subscriber, #33263) [Link]

>If your web site just works perfectly on mobile, you still have the problem that it's not in the app store, so mobile users don't think it exists.

Well, tough luck for them. That said, the other extreme also exists: there are no less than three VLCs in the Android app store, which does not help squat selecting the right one, and one is better off just entering 'vlc android' into google and picking the results from videolan.org. The Internet which, in a way, is also just an app store, just as cnet download.com is. They merely arrange results in different ordering :)

Shumway lands in Firefox

Posted Oct 8, 2013 20:05 UTC (Tue) by robert_s (subscriber, #42402) [Link]

Impressive, but I do wish they would try and get SVG right before they go off on these windmill projects.

Shumway lands in Firefox

Posted Oct 9, 2013 11:38 UTC (Wed) by njwhite (guest, #51848) [Link]

Oh, I was under the impression that SVG support was quite good. I've only knowingly used it in iceweasel for viewing images from wikimedia, but I was considering using them in the future for some websites (now that I have a 230PPI screen I love vectors, you see ;)). Can you point me to information on what's wrong with it? Is it just advanced animation sort of stuff?

Shumway lands in Firefox

Posted Oct 10, 2013 6:48 UTC (Thu) by nim-nim (subscriber, #34454) [Link]

Given that basic stuff like SVG resizing is still not complete ( https://bugzilla.mozilla.org/show_bug.cgi?id=163068 ), when scaling is the whole point of a vector format, I'm pretty sure SVG support is far from done Firefox-side. Probably suffers from the usual "it's cool but the competition does not do it so let's try to catch up on proprietary stuff like flash instead of pushing open functionality (but do a minimal implementation to claim we have the feature anyway)".

Usual chicken-and-eggs "no one uses it because it's not complete, no need to complete it because no one uses it".

Shumway lands in Firefox

Posted Oct 10, 2013 9:17 UTC (Thu) by kleptog (subscriber, #1183) [Link]

Well, to be fair this bug is about a user interface issue, rather than the SVG implementation. All the underlying support is there (the currentScale and currentTranslate DOM attributes) so a small layer of javascript is needed for the controls. There are also extensions that do it.

It's not clear to me that adding a default UI is sensible now since it will just get in the way of sites that want their own UI. For standalone SVG files it may be useful though.

Shumway lands in Firefox

Posted Oct 10, 2013 15:22 UTC (Thu) by nim-nim (subscriber, #34454) [Link]

SVG scaling in the browser has only been implemented correctly in Firefox 24
https://bugzilla.mozilla.org/show_bug.cgi?id=600207

SVG support is not mature at all, basic blocks are still being done (more the pity)

Shumway lands in Firefox

Posted Oct 16, 2013 23:01 UTC (Wed) by robert_s (subscriber, #42402) [Link]

Sorry for not replying sooner.

My favourite lacking area in mozilla's SVG is not actually supporting any blend mode other than "normal" in any usable way: https://bugzilla.mozilla.org/show_bug.cgi?id=437554

Shumway lands in Firefox

Posted Oct 9, 2013 21:52 UTC (Wed) by mikov (subscriber, #33179) [Link]

What really impressed me is that I tried the demos from Chrome on Debian (just by clicking the link) - as far as I can tell they work very well and are fast. The only exception is the MP3 player - I can hear sound coming out, but probably not what was intended.

Shumway lands in Firefox

Posted Oct 10, 2013 21:29 UTC (Thu) by wookey (subscriber, #5501) [Link]

How does the hierarchy work if you have shumway, gnash and lightspark installed? gnash and lightspark hand-off to each other OK. Does installing whumway mean they'll never get a look-in?

It works marginally better on alertme.com than gnash+lightspark does (a few icons and one map are visible rather than nothing). It's the same level of broken on youtube (approx half the stuff works via HTML5 - flash stuff doesn't). It doesn't play BBC iplayer, whilst gnash youtube have recently (at last!) got this working. It seems to be easy to disable it and try with the external players so I guess that'll do. Neither shumway nor lightspark work on vimeo (lightspark gets a bit further).

All these perfectly accessible files wrapped in a tiny bit of flash that prevent me using them has been effing irritating for years. If shumway solves that better than the other efforts then that'll be great.

One does wonder if all this effort applied to one project instead of 4 would have given us better free players sooner, but I guess that's not the way the world works.

Shumway lands in Firefox

Posted Oct 12, 2013 2:10 UTC (Sat) by ncm (subscriber, #165) [Link]

I'd sort of rather see the work go into cclive, to make it better at prying content out of arbitrary sites. (I can barely imagine wanting my browser to run an actual flash app.) But I guess the same consideration applies.

Shumway lands in Firefox

Posted Oct 13, 2013 5:27 UTC (Sun) by glaesera (guest, #91429) [Link]

It is really great, that Mozilla do something to address the current situation with Flash, they do give me the opportunity to link to the FSFE again. So I would rather report Flash-sites here:
http://www.documentfreedom.org/rmflash/
There is a short summary, why it is bad:
http://www.documentfreedom.org/rmflash/about-flash.en.html
This used to work quite well,
http://www.documentfreedom.org/rmflash/html5-how.en.html
but does not work anymore for me.
One can guess that the reasons at Youtube for disabling HTML5-support for many of their videos are not purely technical, but have to do with marketing-concerns and commercial interests.
Nobody will miss all the Flash-commercial-videos, once they have vanished, these can also be provided in HTML5, and also with less impact on system-resources.
The rmflash-campaign at FSFE has been running for some time, but so far sites, that provide Flash-only video-content did not introduce HTML5 as an alternative for their users. Maybe this is because HTML5-developers are unavailable, or simply because there is no video-toolchain for HTML5 like the one they have for flash. Finally the commercials- and ad-industry are used to the way of doing their thing with Flash and prove some inertia regarding the issue.


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