Url of an about:blank document

Koos Vriezen koos.vriezen at xs4all.nl
Sun Dec 1 16:00:33 GMT 2002


Hi,

The KJSDebugWin get its source by setSourceFile and appendSourceFile
interface. The key for source files is its URL. This doesn't work of
course for about:blank documents. I made this patch:

--- khtml_part.cpp      2002/11/29 21:51:06     1.772
+++ khtml_part.cpp      2002/12/01 15:43:41
@@ -3192,6 +3192,11 @@ bool KHTMLPart::processObjectRequest( kh
       if (!url.url().startsWith("about:")) {
         p->write(url.path());
       } else {
+        if (d->m_doc && p->d->m_doc) {
+          static int count = 0;
+          url = d->m_doc->URL() + "_" + url.url() + "_" + QString::number(count++);
+          p->d->m_doc->setURL(url.url());
+        }
        p->m_url = url;
         // we need a body element. testcase: <iframe id="a"></iframe><script>alert(a.document.body);</script>
         p->write("<HTML><BODY></BODY></HTML>");

which makes the url unique again (eg http:/www/index.html_about:blank_23).

Do you see any problems here?
Note that before, p->m_url and p->d->m_doc->m_url were different, which
made them turn up twice in the debugger.

Koos





More information about the kfm-devel mailing list