java plugin in nspluginviewer

Till Krech till at snafu.de
Sun Oct 20 23:05:20 BST 2002


Hi,

I'm currently trying to get the sun/netscape java plugin working in 
nspluginviewer/konqueror.
The plugin is used when the applet is defined in the html page via <object> or 
<embed> tag.

There are several problems:
1) I do not get any debug output from nspluginviewer. It is started from a 
KProcess within the plugin_part in konqueror. My workaround: use 
receivedStderr signal and a slotStderr wich does a kdDebug. Not very nice.

2) Width and height of a plugin are set to 1600 x 1200 by default.
Applets are then really that big (behind the scenes) and the embedded widget 
only shows a small part of most applets. 
The width and height attributes of an <object> tag are not passed to the 
plugin which only understands parameters such as
<param name="width" value="400"> 
I found a workaround by 'converting' the attributes to pseudo params 
__KHTML__WIDTH and __KHTML_HEIGHT in khtml/rendering/render_frames.cpp as it 
is already done with other attributes like this:
      params.append( QString::fromLatin1("__KHTML__WIDTH=\"%1\"").arg( 
o->getAttribute(ATTR_WIDTH).string() ) );
      params.append( QString::fromLatin1("__KHTML__HEIGHT=\"%1\"").arg( 
o->getAttribute(ATTR_HEIGHT).string() ) );

3) The java plugin does not work with user agent strings other than Netscape 
4.7. It is possible to define a pseudo domain 'nspluginviewer' and to set the 
user agent string for this domain. But this makes not much sense. Why should 
a user be able/obligated to configure this ? Netscape plugins are for 
Netscape browsers. nspluginviewer can only handle ns4 plugins.

4) there are crashes in the nspluginviewer because of memory corruption. I 
tried to run konqueror with valgrind --trace-children but it stops when 
loading the netscape plugin shared object file.

5) I found a (in my eyes) weird problem. Look at this (kdebase/nsplugins):
In nsplugin.h:
class NSPluginStreamBase : public QObject
{
Q_OBJECT
...
private:
----->   QByteArray _queue;
...
}

and in nsplugin.cpp:
NSPluginStreamBase::~NSPluginStreamBase()
{
   if (_stream) {
      _instance->NPDestroyStream( _stream, NPRES_USER_BREAK );
      delete _stream;
   }

   delete _tempFile;
----->   delete _queue;
}

_queue is not a pointer. What happens upon delete ? Isn't _queue deleted 
automatically when NSPluginStreamBase is deleted?

6) I think that artswrapper does not work with java. Made some experiments 
some time ago. Should it be disabled by default then when we start the 
nspluginviewer with the java plugin ?

regards, till
-- 
Till Krech from Berlin, Germany is happy with
SuSE Linux 8.0 (i386) 2.4.18-64GB-SMP * KDE: 3.0.8 (KDE 3.1 beta2)
Qt: 3.1.0-b2 * gcc version 3.2





More information about the kfm-devel mailing list