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

Disabling cross-origin doesn't work programmatically

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.11.1, 5.12.0
    • Fix Version/s: 5.12.0 Beta 3
    • Component/s: WebEngine
    • Labels:
      None
    • Environment:
      Windows 10 x64
      MSVC Prof. 2017 15.8.1
    • Platform/s:
      Windows
    • Commits:
      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

            Assignee:
            juri.valdmann Jüri Valdmann (Inactive)
            Reporter:
            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