Results 1 to 3 of 3

Thread: WebKit / WebEngine URL substitution

  1. #1
    Join Date
    Feb 2011
    Posts
    354
    Thanks
    17
    Thanked 27 Times in 24 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default WebKit / WebEngine URL substitution

    I'm developing the project featuring Qt4 WebKit based browser (will have it moved to Qt5 in the future). It would be nice to allow the users to open .onion sites (dark web), which is not directly possible. In order to achieve this the original url must be modified by adding a special suffix. So my question is whether it is possible to intercept the URL that is going to be opened by the Qt browser and substitute it with the new transformed one?
    Magicians do not exist

  2. #2
    Join Date
    Jul 2012
    Posts
    201
    Thanks
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: WebKit / WebEngine URL substitution

    I don't know if this is possible with QWebKit. But QWebEngineUrlRequestInterceptor is worth looking at.

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: WebKit / WebEngine URL substitution

    For Qt4 webkit it should be possible to achieve this by using a custom QNetworkAccessManager.

    Basically derive from that class, implement createRequest() such that you create a modified QNetworkRequest object and pass that to the base class implementation.

    Cheers,
    _

Similar Threads

  1. Porting Qt WebKit based project to Qt 5.7 (Qt WebEngine)
    By Ginsengelf in forum Qt Programming
    Replies: 0
    Last Post: 30th November 2016, 14:20
  2. Replies: 5
    Last Post: 31st July 2014, 00:52
  3. Replies: 3
    Last Post: 15th November 2007, 14:09
  4. qDebug macro substitution
    By the_bis in forum Qt Programming
    Replies: 2
    Last Post: 15th November 2006, 09:31

Tags for this Thread

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.