[prev in list] [next in list] [prev in thread] [next in thread] 

List:       konq-bugs
Subject:    [Bug 134791] Amazon.com product pages: redirect to ad
From:       Maksim Orlovich <maksim () kde ! org>
Date:       2006-09-30 14:35:33
Message-ID: 20060930143533.26828.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=134791         
maksim kde org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From maksim kde org  2006-09-30 16:35 -------
SVN commit 590600 by orlovich:

Evaluate scripts in <iframe src=javascript:..> in the right context.
Affects amazon and freemail.hu
BUG:134791
BUG:106748



 M  +13 -6     khtml_part.cpp  


--- branches/KDE/3.5/kdelibs/khtml/khtml_part.cpp #590599:590600
 @ -4314,12 +4314,19  @
   // Support for <frame src="javascript:string">
   if ( url.find( QString::fromLatin1( "javascript:" ), 0, false ) == 0 )
   {
-      QVariant res = executeScript( DOM::Node(frame->element()), \
                KURL::decode_string( url.right( url.length() - 11) ) );
-      KURL myurl;
-      myurl.setProtocol("javascript");
-      if ( res.type() == QVariant::String )
-	myurl.setPath(res.asString());
-      return processObjectRequest(*it, myurl, QString("text/html") );
+    if ( processObjectRequest(*it, KURL("about:blank"), QString("text/html") ) ) {
+      KHTMLPart* p = static_cast<KHTMLPart*>(static_cast<KParts::ReadOnlyPart \
*>((*it)->m_part)); +      
+      // See if we want to replace content with javascript: output..
+      QVariant res = p->executeScript( DOM::Node(), KURL::decode_string( url.right( \
url.length() - 11) ) ); +      if ( res.type() == QVariant::String ) {
+        p->begin();
+        p->write( res.asString() );
+        p->end();
+      }
+      return true;
+    }
+    return false;
   }
   KURL u = url.isEmpty() ? KURL() : completeURL( url );
   return requestObject( *it, u );
_______________________________________________
Konq-bugs mailing list
Konq-bugs@mail.kde.org
https://mail.kde.org/mailman/listinfo/konq-bugs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic