Results 1 to 5 of 5

Thread: Hacking QWebkit

  1. #1
    Join Date
    Jul 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Hacking QWebkit

    I working on custom browser and I need to change QWebkit to work as I describe below:
    when I load a url into webkit, webkit has to change requests to custom a url
    which means NetworkRequest urls has to change to a custom url for example:
    if user loads http://www.google.com networkrequests has to send to http://mycustomeserver.com/q?www.google.com

    Anyone has idea how can I do this?

    Thanks in advance

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Hacking QWebkit

    Honestly I'd do it through a network (or web) proxy and not through WebKit But if you really have to do it this way, then set a custom QNetworkAccessManager on the webview's webpage and reimplement QNetworkAccessManager::createRequest() where you will change the request object and call the base class implementation.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Hacking QWebkit

    and i was thinking only our boss has weird ideas

  4. #4
    Join Date
    Jul 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Hacking QWebkit

    Quote Originally Posted by wysota View Post
    Honestly I'd do it through a network (or web) proxy and not through WebKit But if you really have to do it this way, then set a custom QNetworkAccessManager on the webview's webpage and reimplement QNetworkAccessManager::createRequest() where you will change the request object and call the base class implementation.
    I tried to do this by creating subclass of QNetworkAccessManager and reimplement createRequest and setting my QNetworkAccessManager as QNetworkAccessManager in webview's webpage using setNetworkAccessManager.. but seems Webkit don't use MyAccessManager and does it using original one as i tried to checking by debuging application
    but I'm not Qt Expert would you show me how to reimplement QNetworkAccessManager and how to use it in my Webview's webpage instance ( by code)?

    Many Thank in advance, you effort will help many ppl

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Hacking QWebkit

    Please show your code (as you already have it written and I don't) and we will correct it.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QWebkit webcast now online
    By Brandybuck in forum Qt Webkit
    Replies: 3
    Last Post: 15th January 2009, 23:46
  2. performance of QWebKit() in QGraphicsProxyWidget
    By wagmare in forum Qt Programming
    Replies: 11
    Last Post: 8th December 2008, 10:26
  3. Filling forms with QWebKit
    By physicistjedi in forum Qt Programming
    Replies: 1
    Last Post: 4th December 2008, 18: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.