[webkit-qt] Java Applet patch for QtWebKit progressing...

Garth Dahlstrom ironstorm at gmail.com
Sun Mar 21 23:41:06 PDT 2010


FYI for anyone interested in the progress of this, I'd say it's moving to later stages now... 

It took me a really long time to figure out the cause of the seg fault crash, but I eventually figured it out after much trawling though Git deltas...  It was caused by NPVersion() returning a version of NPAPI that WebKit didn't actually support (someone bumped it after Qt 4.5.3 -- WebKit Bug #34539) and by the Java plugin actually calling those missing APIs to fetch info from the host app (which is also why the debug traces are non-Qt/non-App junk). 

To get Applets going, you must apply 3 patches in your src/3rdparty/webkit or qtwebkit-source-2.0 folder:

  1) Implement NPN_(Get|Set)ValueForURL I created for #34539 -> https://bugs.webkit.org/attachment.cgi?id=51264
     - If anyone knows how to get WebKit's http proxy info without calling Qt classes directly, please let me know

  2) The original Java Applet support patch I created for #33044 -> https://bugs.webkit.org/attachment.cgi?id=51265
     - On Windows this will search the registry to find the plugins
     - On Linux, and OSX it will search the paths shown in PluginDatabase.cpp (i.e. contents of QTWEBKIT_PLUGIN_PATH environment variable, or locations like "/Library/Internet Plug-ins/" on OSX)

  3) A 1-line patch to Arora to enable Java Applet support -> https://bugs.webkit.org/attachment.cgi?id=49066
OR
  4) A 1-line patch to QtLauncher to enable Java Applet support -> https://bugs.webkit.org/attachment.cgi?id=51268

These patches together will allow Java to run on Arora/QtLauncher on Windows, they may also work on OSX and Linux.   I have not been able to successfully get this going on OSX, rather I see a blue brick which I suspect is a plugin/plugin-bundle configuration issue coming from me having a x86_64 build arch and not having the plugins in the right places (I get various CFBundle not found messages relating to Java).

Could use help with:
  - people testing on other OSes, I don't have test machines or much time to test beyond Windows.

  - help with improving these patches so they can be moved upstream.

  - creating a non-stub implementation for NPN_GetAuthenticationInfo

  - writing some kind of tests for the WebKit build processes

Cheers,

-G
IRC: jumpkick

Here are those bugs for reference:
https://bugs.webkit.org/show_bug.cgi?id=34539 -- Wrong NPVersion() + NPN_(Get|Set)ValueForURL implementation patch 
https://bugs.webkit.org/show_bug.cgi?id=33044 -- Java Applet patch


On 2009-12-30, at 2:16 AM, Garth Dahlstrom wrote:

> On 2009-12-29, at 9:33 AM, Kenneth Christiansen wrote:
> 
>> Hi there Garth!
> 
> Hi Kenneth,
> 
>> That is really good news! You should create a bug report for tracking your progress on bugs.webkit.org, could you do that?
> 
> It is done!  :D   Bug #33044 ( https://bugs.webkit.org/show_bug.cgi?id=33044 )
> 
>> Instead of rebasing it to the Qt 4.6, you should make it work for trunk WebKit. There is a gitorious git clone of WebKit svn trunk at gitorious.org, you could use that for helping the rebasing.
> 
> Unfortunately, I have a requirement to deliver a product based on a stable version of Qt.   So while I agree it would make things easier from a WebKit source integration perspective, I don't have the cycles / capability to integrate and test an unstable WebKit into Qt (my experience has been both WebKit and Qt are quite large beasts to build).   My hope is if it does get ported to Qt 4.6 it will be a straightforward apply to Git trunk being that the trail will be less cold then snapshot used for Qt 4.5.
> 
> Cheers,
> 
> -G
> 
> 
>> Cheers and happy new year.
>> Kenneth 
>> 
>> On Wed, Dec 23, 2009 at 9:44 PM, Garth Dahlstrom <gdahlstrom at 2keys.ca> wrote:
>> Hi QtWebkit and Arora lists,
>> 
>> A colleague (John Spicer) and I have been working on a patch to support Java Applets in QtWebKit.    We finally have something that sort of works and are now keen to rally some help from the interested communities to get over the latest humps, complete the effort and get it rolled up into QtWebkit and Qt.
>> 
>> Qt w/ WebKit + WebKit debugging symbols can be a bit unruly to get built, but I'm somewhat of an expert at building the beast, so if anyone needs assistance getting set-up let me know (I can post an entire Qt 4.5.3 build w/ patch applied if that helps).
>> 
>> You can see the patch in action, using with Qt's Demo Browser app, here:
>>  -> http://arora-dev.googlegroups.com/web/qt-demos-browser-java-applet.png?gsc=uyLiEwsAAAA_opuiF-PJ23f8yKxuAQCQ
>>   [Note: that JavaEnabled must be set to true in the Demo Browser application as is highlighted at the top of the screenshot, line 247]
>> 
>> What have going:
>> * Sun Plugin2 applet working - requires Java 1.6.0 update 17
>> * Loads Applets contained in Jar files -- i.e. http://java.com/en/download/help/testvm.xml works
>> * Windows is the only place we've been working
>> 
>> What we need help with:
>> * Rebasing the patch onto 4.6.0 (we had a go at it, but a lot has changed between 4.5.3 and 4.6.0, and we were not successful)
>> * Porting the patch to other platforms OSX, Linux
>> * .class based applets like that found on javatester.org, doesn't load... (I've included that at the bottom of this message)
>> * Testing and test cases for things that need to be checked
>> * other stuff I'm not thinking of?
>> 
>> I'm looking for help in whatever capacity people can help in and advice on how to move this ball forward.
>> 
>> Cheers & Happy Holidays,
>> 
>> -G
>> 
>> Garth Dahlstrom, 2Keys Corporation
>> IRC: jumpkick
>> gtalk: ironstorm
>> 
>> 
>> 
>> 
>> 
>> 
>> JavaTester .class based applet exception from Java Console:
>> 
>> basic: Added progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener at 12b3d53
>> network: Cache entry not found [url: http://javatester.org/version.html/JavaVersionDisplayApplet.class, version: null]
>> network: Connecting http://javatester.org/version.html/JavaVersionDisplayApplet.class with proxy=DIRECT
>> network: Connecting http://javatester.org:80/ with proxy=DIRECT
>> network: Cache entry not found [url: http://javatester.org/version.html/JavaVersionDisplayApplet/class.class, version: null]
>> network: Connecting http://javatester.org/version.html/JavaVersionDisplayApplet/class.class with proxy=DIRECT
>> basic: load: class JavaVersionDisplayApplet.class not found.
>> load: class JavaVersionDisplayApplet.class not found.
>> java.lang.ClassNotFoundException: JavaVersionDisplayApplet.class
>>    at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
>>    at java.lang.ClassLoader.loadClass(Unknown Source)
>>    at java.lang.ClassLoader.loadClass(Unknown Source)
>>    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
>>    at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
>>    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
>>    at java.lang.Thread.run(Unknown Source)
>> Caused by: java.io.IOException: open HTTP connection failed:http://javatester.org/version.html/JavaVersionDisplayApplet/class.class
>>    at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
>>    at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
>>    at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
>>    at java.security.AccessController.doPrivileged(Native Method)
>>    ... 7 more
>> Exception: java.lang.ClassNotFoundException: JavaVersionDisplayApplet.class
>> _______________________________________________
>> webkit-qt mailing list
>> webkit-qt at lists.webkit.org
>> http://lists.webkit.org/mailman/listinfo.cgi/webkit-qt
>> 
>> 
>> 
>> 
>> -- 
>> Kenneth Rohde Christiansen
>> Technical Lead / Senior Software Engineer
>> Qt Labs Americas, Nokia Technology Institute, INdT
>> Phone  +55 81 8895 6002 / E-mail kenneth.christiansen at openbossa.org
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20100322/66ed8ec5/attachment.html>


More information about the webkit-qt mailing list