Page MenuHomePhabricator

Couldn't play inline in Opera, when Opera directly accesses Java
Closed, ResolvedPublic

Description

The OggHandler tests for "navigator.javaEnabled()" and for the existence of the MIME-type "application/x-java-applet". The second test fails, if Opera directly access Java and not uses a java plugin dll. I think the first test is sufficient, because Java isn't a plugin in every browser but could be supported natively (like in Opera).


Version: unspecified
Severity: normal
OS: Windows Vista
Platform: PC

Details

Reference
bz11231

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:52 PM
bzimport set Reference to bz11231.

Do you have plugins enabled? It's in the Tools>Quick Preferences menu. The first test is not sufficient, see bug 10949.

Of course plugins are enabled. But as I mentioned in my first comment, Opera doesn't need a Java plugin, but is able to access Java directly. So only if you have the NPJavaXX.dll (e.g. NPJava14.dll) in your plugins folder the MIME-type exists in navigator.mimeTypes, because otherwise it isn't a plugin.

I'm not sure, if it's a bug in Opera or not, because I don't find clear information, if mimeTypes is only for plugins but for all recognized MIME types. Most sources only speak of plugins, but some documents on mozilla.org speak of "each MIME type supported by the client (either internally, via helper applications, or by plug-ins)." (see http://devedge-temp.mozilla.org/library/manuals/2000/javascript/1.3/reference/nav.html#1193368). The problem is: most browsers - like Firefox - don't have any internally supported MIME-types in the mimeTypes array. Opera _normally_ has (e.g. "image/jpg" with enabledPlugin set to null). But it doesn't have an entry for "application/x-java-applet" - which seems to be a bug.

But even if it would be in the mimeTypes array, the OggHandler wouldn't work, because it tests, if there is a plugin - which isn't true, if it's internally supported. Maybe one could argue, that there should be a reference to "Mozilla default plugin", but no browser does this and the standard doesn't declare anything about that.

So I don't really have a solution. That navigator.javaEnabled() could be true, if there is no Java on the machine, was new to me - I personally think, a browser should disable java, when there is no java present. So I would only test javaEnabled() ;)

You could just install the plugin, couldn't you?

You don't have to give me references for the navigator.mimeTypes array -- I read them before I wrote the software, and I studied the contents of navigator.mimeTypes on Opera on my own system. The Mozilla plugin will add application/x-java-applet to navigator.mimeTypes in both Mozilla and Opera.

Alright, my mistake, it looks like Opera is pulling a Java plugin out of my Netscape Communicator directory, of all places. It doesn't seem to load the Mozilla plugin in the JRE directory, so it wouldn't work on a standard install of Opera and Java. I'll put in a special case.

Special case done in r25673, live on Wikimedia right now.

It turns out that Opera silently disables the "Java enabled" user preference, and hence navigator.javaEnabled(), if it fails to load a Java DLL. Browser detection (navigator.appName) is the only reasonable way to account for this difference between Opera and Mozilla.

Thanks a lot! It works now.

Your work is great - thanks for the player. I never had doubts about your JavaScript references knowledge, but some things are - as you know - really weird in some browsers (especially the differences between browsers because of obscurities in standards). Thats why I pointed out the special behavior of Opera in this case.