Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. How to find a cookie origin URL with QWebEngine
Forum Updated to NodeBB v4.3 + New Features

How to find a cookie origin URL with QWebEngine

Scheduled Pinned Locked Moved Unsolved QtWebEngine
1 Posts 1 Posters 606 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    stefano.crocco
    wrote on last edited by
    #1

    Hello to everyone.

    I'm trying to improve the integration between Konqueror, the KDE browser, and QWebEngine and I'm struggling on how to deal with cookies. To fully integrate with the KDE environment I can't download files using QWebEngineDownloadItem but I have to use the infrastructure provided by KDE, named KIO. The problem arises when downloading files from sites requiring authentication (for example, my bank site). To make the download work, I need to share cookies between QWebEngine and KIO. The problem is that to add a cookie to KIO I need to specify the URL it originates from but, unfortunately, as far as I can tell, QWebEngine and QWebEngineCookieStore in particular don't provide this information.

    For the time being, I found a workaround by registering the URL a QWebEnginePage is navigating to from its acceptNavigationRequest method and using that URL from the slot connected to QWebEngineCookieStore::cookieAdded signal. However, I don't like this solution at all, also because there can be more than one page loading at the same time and I don't think there are warranties about the order the cookies will be added in this case. So, my question is: is there a way I'm overlooking to retrieve the origin URL from a cookie using the API provided by QWebEngine?

    Thanks in advance

    Stefano

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved