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

window.open Windows with WebEngine Default userAgent

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3: Somewhat important P3: Somewhat important
    • 5.9.2
    • 5.9.1
    • WebEngine
    • None
    • Linux Mint 18.1

      Qt 5.9.1
    • 721a4d1c99159e3eb5bbefeb4ac8a81e66cc7164

      I did a tiny change at the QT DemoBrowser example and added a line to change the useragent at webview constructor.

      this->page()->profile()->setHttpUserAgent("Test");

      If i execute the js code

      navigator.userAgent

      on the console at all tabs i get the result "Test".

      If i execute the js code

      window.open("https://www.w3schools.com", "_blank", "toolbar=yes,scrollbars=yes,resizable=yes,top=500,left=500,width=400,height=400");

      on the console at e.g. the first tab i get a new window.

      If i execute the js code

      navigator.userAgent

      on the new window i get

      "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.9.1 Chrome/56.0.2924.122 Safari/537.36"

      I expected "Test". If you have a different Qt WebEngine Browser running it can also take there useragents

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

            qt_webengine_team Qt WebEngine Team
            jurkov jurkov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes