Results 1 to 4 of 4

Thread: modifying webkit content before loads

  1. #1
    Join Date
    May 2008
    Location
    Melbourne, Australia
    Posts
    136
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default modifying webkit content before loads

    I am using QtWebkit.QWebView as a basic browser and am trying to modify the HTML content before it starts downloading media and rendering.

    The loadStarted signal is emitted before downloading the webpage, loadProgress during rendering, and loadFinished after rendering, which don't seem to help.

    Can this be done?

  2. #2
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: modifying webkit content before loads

    As I see it, there is no way that you can modify something that don't have. So, modifying the HTML before you've downloaded it sounds impossible.

    What you could do is to use a custom QNetworkAccessManager which your QWebView uses. That way, you can monitor any HTML before it reaches the QWebView.

  3. #3
    Join Date
    May 2008
    Location
    Melbourne, Australia
    Posts
    136
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: modifying webkit content before loads

    yeah so obviously I am not trying to modify the HTML before it is downloaded...

    I want to modify it to remove certain images, flash, etc. I'll check out QNetworkAccessManager.

  4. #4
    Join Date
    May 2008
    Location
    Melbourne, Australia
    Posts
    136
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: modifying webkit content before loads


Similar Threads

  1. Replies: 4
    Last Post: 23rd September 2010, 15:20
  2. Replies: 3
    Last Post: 25th February 2010, 08:53
  3. Modifying file with Qt
    By afail in forum Qt Programming
    Replies: 1
    Last Post: 14th December 2009, 14:34
  4. Modifying a text
    By jaca in forum Qt Programming
    Replies: 3
    Last Post: 6th May 2008, 15:50
  5. Modifying a line in a QTextEdit
    By elcuco in forum Qt Programming
    Replies: 1
    Last Post: 15th March 2008, 16:50

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.