good news: nspluginviewer HTTP POST Support

Till Krech till at snafu.de
Tue Nov 5 20:38:51 GMT 2002


On Tuesday 05 November 2002 21:00, David Faure wrote:
> On Tuesday 05 November 2002 20:45, Till Krech wrote:
> > On Tuesday 05 November 2002 20:20, David Faure wrote:
> > > Hmm is it supposed to _return_ a string from that method, and use it as
> > > the contents of the frame, or simply to call that method?
> >
> > No, it isnt supposed to return something. it basically does a javascript
> > window.open(...)
>
> Ok. I wonder if there aren't cases where the browser is supposed to show
> the result of the function, when it does return something. That's how it
> works (or should work) in many other places.
>
> > > If the latter, this patch might be enough.
> >
> > And yes, it works in this case.
> > Can it break something else ?
>
> No, it can't.
> Old behaviour:
> * framename set -> openURLRequest/createNewWindow (fails with javascript:
> urls) * framename not set -> javascript: handled (ignoring framename), then
> the normal case New behaviour:
> * javascript: urls handled first (not better nor worse than before, still
> ignoring framename) * framename set -> openURLRequest/createNewWindow
> * framename not set -> javascript: handled, then the normal case
>
> I guess it can do for now (unless Dirk objects :).
> IMHO the real fix is to call requestFrame, at least when the framename
> is empty, or points to an existing childframe. Not sure what should happen
> with _parent though, or _blank .... especially when the JS returns
> something. Many cases to test...

First, a small addition to your patch. At least when called from the plugin, 
the javascript url is urlencoded because once on the way a KURL is made from 
a QString. Therefore, my version looks like this:

+  if ( urlStr.find( QString::fromLatin1( "javascript:" ), 0, false ) == 0 ) {
+      QString script = KURL::decode_string( urlStr.right( urlStr.length() - 
11 ) );
+      executeScript( script );
+      return;

Second. Can a javascript: url in any case return something?
A javascript handler like onclick can (true or false) and it means wether the 
normal link target is executed or not.  But if I have
<a href="javascript:sayHelloWorld()"> it does not make much sense.

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





More information about the kfm-devel mailing list