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

WebEngine pages loaded from disk can't load stylesheet resources from QRC

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.9.2
    • WebEngine
    • None
    • Windows 10,

      Qt 5.9.2

    Description

      I'm trying to migrate my application to use binary resources bundled with the executable instead of individual files.  However, I've discovered a problem related to stylesheets.

       

      I've created a simple file to load into the quicknanobrowser example containing the following

      <head>
      <style type="text/css">
      @font-face {
      font-family: Raleway-Bold;
      src: url(qrc:///fonts/Raleway-Bold.ttf);
      }
      body {
      background-color: lightblue;
      font-family: "Raleway-Bold";
      }
      </style>
      </head>
      <body>
      <img src="qrc:///icons/go-next.png"/>
      </body>

       The image resource loads fine, but the stylesheet refuses to load the font and reports the error 

      "Access to Font at 'qrc:///fonts/Raleway-Bold.ttf' from origin 'file://' has been blocked by CORS policy: Invalid response. Origin 'file://' is therefore not allowed access.", source: file:///C:/Qt/Examples/Qt-5.9.3/webengine/quicknanobrowser/index.html (0)

      Attachments

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

        Activity

          People

            viengelm Viktor Engelmann
            jherico Bradley Austin Davis
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes