Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-109673

Need the ability to call setHttpUserAgent without forcing an automatic reload

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Not Evaluated
    • None
    • 5.15.11
    • WebEngine
    • None
    • Linux/X11

    Description

      Currently, calling QWebEngineProfile::setHttpUserAgent forces a reload of the website. This would appear to be desired behavior, but there are times when the user agent needs to be changed without forcing a reload. For example, I sometimes need to change the user agent based on the URL that is being loaded. To do this, I inspect changes using a UrlRequestInterceptor. If it is changing in a way that needs a different user agent, I set the new one using setHttpUserAgent. However, this currently causes the WebEngine to reload the old URL, which interrupts the loading of the new URL.

      It would seem that the best way to handle this is for setHttpUserAgent to change the user agent that will be used for future requests but not force a reload, leaving that up to the discretion of the programmer. Alternatively, the method could accept a boolean indicating if a reload should be automatically initiated after the user agent is changed.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt_webengine_team Qt WebEngine Team
            sorenstoutner Soren Stoutner
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes