Please view: about:blank fix
Harri Porten
porten at kde.org
Sat Feb 10 15:15:14 GMT 2007
Hello,
I'm can't fully follow report http://bugs.kde.org/139248 but I can confirm
that other browsers have location.href="about:blank" and
location.pathname="" for windows openend by window.open() and
window.open("about:blank").
I'd like to apply the attached patch that handles this special case but
I'm not fully certain about it as I don't know where about:blank is turned
into an empty KURL.
Harri.
-------------- next part --------------
Index: ecma/kjs_window.cpp
===================================================================
--- ecma/kjs_window.cpp (revision 632222)
+++ ecma/kjs_window.cpp (working copy)
@@ -2508,11 +2508,15 @@
case Hostname:
return String( url.host() );
case Href:
- if (!url.hasPath())
+ if (url.isEmpty())
+ return String("about:blank");
+ else if (!url.hasPath())
return String( url.prettyURL()+"/" );
else
return String( url.prettyURL() );
case Pathname:
+ if (url.isEmpty())
+ return String("");
return String( url.path().isEmpty() ? QString("/") : url.path() );
case Port:
return String( url.port() ? QString::number((int)url.port()) : QString::fromLatin1("") );
More information about the kfm-devel
mailing list