On Tuesday 05 November 2002 22:19, David Faure wrote: > On Tuesday 05 November 2002 21:38, Till Krech wrote: > > 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; > > This looks consistent with slotRedirect...... But it also looks > unnecessarily obfuscated: wouldn't url.path() do the job? It should both > remove the protocol and decode the string. hmm... try this: javascript:document.images.length/2 isn't the path "/2" ? and host "document.images.length" and another: javascript:confirm("Really leave this page? You will miss this & that.") Isn't there a query in it ? > > > Second. Can a javascript: url in any case return something? > > Yes. I've seen it many times. > For instance, try > > > > > A javascript handler like onclick can (true or false) and it means wether > > the normal link target is executed or not. > > Yes. > > > But if I have > > it does not make much sense. > > I thought so too... but try this in mozilla (and IE probably too) : > > > click here Oops. Didn't know that. > > Yes, when you click the link, it _replaces_ the current page with the html > returned by the javascript code. I guess it's the equivalent of > document.write(result_of_javascript_eval), which does the same thing. > We don't handle this case yet - that's the case that needs code like > the one in requestFrame(). Ok. This seems to be something for KDE 3.2 Concerning the small patch. It fixes at least the bug on http://www.cocacola.com where you currently cannot click the links. Would you like to commit ? 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