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

PDF viewer in iFrame is frozen

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.15.4
    • 5.15.2
    • WebEngine
    • None
    • Python 3.8.6, Linux or Windows
    • Linux/X11, Windows
    • Ib1591fbd9a594891cdeace8e9dae0d3cc21a9f8e

    Description

      Steps to reproduce:

      Note warnings

      js: Blocked autofocusing on a form control in a cross-origin subframe.
      js: Blocked autofocusing on a form control in a cross-origin subframe.
      [51329:51329:0128/140711.052560:ERROR:extension_function_dispatcher.cc(487)] Permission denied for metricsPrivate.recordValue
      js: Unchecked runtime.lastError: Access to extension API denied.
      js: Uncaught (in promise) TypeError: Cannot read property 'getStrings' of undefined
      js: Uncaught Error: Assertion failed
      

      Displaying a PDF works good using QWebEngine when the PDF is the source of the page.

      If I try to display a PDF in a iFrame, the viewer is shown but it looks frozen, I can't interact with scroll bars or zoom

      Sample test page : https://fr.w3docs.com/tools/code-editor/1805

      attached sample code used
       

      import sys
      from PySide2 import QtCore, QtWidgets, QtWebEngineWidgets
      
      class Widget(QtWidgets.QWidget):
          def __init__(self):
              super(Widget, self).__init__()
              lay = QtWidgets.QVBoxLayout(self)
              self.browser = QtWebEngineWidgets.QWebEngineView()
              settings = self.browser.settings()
              settings.setAttribute(settings.PluginsEnabled, True)
              settings.setAttribute(settings.PdfViewerEnabled, True)
              lay.addWidget(self.browser)
              self.browser.setUrl(QtCore.QUrl("https://fr.w3docs.com/tools/code-editor/1805"))
      
      if __name__ == '__main__':
          app = QtWidgets.QApplication(sys.argv)
          view = Widget()
          view.showMaximized()
          sys.exit(app.exec_())

       For information, there's the same problem using PyQt5 5.15.2, so the problem could be on Qt5 side
       

      Attachments

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

        Activity

          People

            davidsz Szabolcs David
            doudz Sébastien RAMAGE
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes