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

Disabling cross-origin doesn't work programmatically

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.12.0 Beta 3
    • 5.11.1, 5.12.0
    • WebEngine
    • None
    • Windows 10 x64
      MSVC Prof. 2017 15.8.1
    • Windows
    • 098680710ad3db2e9bd62928a9e2fb1c7cb8c4a9 (qt/qtwebengine/5.12)

    Description

      Hi all,

      I'm using pdf.js out of the resource system (qrc) and if I want to load a local pdf file the engine moans:

      Cross origin requests are only supported for protocol schemes: http, data, chrome, https.", source: qrc:///pdfjs/pdfjs/pdf.worker.js (13)
      

      I've tried, as the documentation stated about the QWebEngineSettings, to disable the cross origin rule via QWebEngineSettings::LocalContentCanAccessRemoteUrls.

      I've set this attribute in the WebEngineView and in the WebPage too, but it doesn't solve the issue.

      I've tried QWebEngineSettings::LocalContentCanAccessFileUrls additionally too, without any effect.

      There was no other way to turn it off as setting up the argument "--disable-web-security" for QApplication during the start.

      I would say it's a bug, or?

      Attachments

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

        Activity

          People

            juri.valdmann Jüri Valdmann (Inactive)
            lachrymology Mike
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes