Loading Blog Search...

Wednesday, November 12, 2008

Develop Browser Plugin based on Windows Mobile

NPAPI is supported by various Web browser engines, such as WebKit and Gecko. Iris browser is a WebKit based Web browser that can run on Windows Mobile. So, we could extend Iris with NPAPI plugin.

I am not sure whether Iris provide develop environment for plugin. We might need to find another way to build plugin.

What I tried first is to build minimo, and study whether can build plugins based on minimo. Unfortunately, seems minimo does not support plugins well. Anyway, I write down my experiment for reference.

  • Build minimo
minimo is the minisized Mozilla running on Windows Mobile, and I guess it is a good start point to build plugin, as all its codes are available. http://www-archive.mozilla.org/projects/minimo/WinCE/build.html gives the steps to build minimo. Here, just add some points:
  1. I met the problem@http://forums.mozillazine.org/viewtopic.php?f=47&t=553405, solved by adding one line ac_cv_static_assertion_macros_work=yes before the line of "if eval "test \"`echo '$''{'ac_cv_static_assertion_macros_work'+set}'`\" = set"; then". I do not know the reason, and after it pass, and I revert the configure to original version, it still works
  2. on Windows Vista, \moztools\bin\nsinstall.exe requires administrator right, so, I run console by administrator to build.
  3. Then I met another issue: SEE_MASK_FLAG_DDEWAIT and SEE_MASK_INVOKEIDLIST undefined in nsOSHelperAppService.cpp, solved by using patch from https://bugzilla.mozilla.org/show_bug.cgi?id=402948
It takes 1~2 hours on my DualCore 1.86G Dell Precision PWS390 to build minimo.
  • qtWebKit as plugin development SDK

Although minimo runs smoothly on my emulator, but I found it does not support plugins (if I am wrong, let me know, tkz). qtWebKit is the Windows Mobile port of WebKit engine. It's the next candidate I tried. Please goto http://code.staikos.net/ for latest sources.

I download qtwebkit 4.5 from SVN repository http://svn.webkit.org/repository/webkit/trunk, version 37064. http://git.webvm.net/ provides npsimple, a simple plugin sample running on Windows Mobile.

I built npsimple with VS2008, after setting include directory in the project. Please make sure the directory setting contains those with npruntime.h and npfunctions.h. For the qtWebKit I downloaded, they are:

  1. WebCore\bridge
  2. WebCore\plugins

To try the plugin, I installed Iris browser based on WebKit to my Window Mobile emulator (WM5)(http://www.torchmobile.com/blog/?p=5), and then copy the built plugin to plugins folder under where I install Iris browser (http://www.torchmobile.com/blog/?p=9).

All done! Just open the html coming with npsimple project and see the result.

1 comment:

Peter said...

Hi!

I'm trying to reach you through the message board, but it does not seem working. I'm trying to do the same as you did - running qtwebkit on windows mobile. Now, as Iris is nonexisting, and http://code.staikos.net/ is not working anymore, do you see any way to repeat and study what you did? If you have any ideas, don't hesitate to contact me at peter.smulovics@gmail.com

Thanks in advance,
Peter Smulovics