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

QtWebKit does not report JS errors(exceptions) thrown from JavaScript signal handlers

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.6.3, 5.7.1
    • 5.2.0, 5.2.1, 5.3.0 Beta1
    • WebKit
    • None

      QtWebKit does not report JS errors(exceptions) thrown from JavaScript signal handlers with QWebPage::javaScriptConsoleMessage.

      Steps to reproduce:
      1. Create QtWebKit application which uses your custom WebPage class derived from QWebPage.
      2. Override javaScriptConsoleMessage method in your WebPage and log incoming messages to console.
      3. Confirm you get javaScriptConsoleMessage callbacks on JS errors.
      4. Make some QObject instance (any object which has any signal) accessible from JS (use addToJavaScriptWindowObject call) ("myObject" object with "somethingChanged" signal, for instance)
      5. From JS connect handler(JS function) to the signal
      6. Make some error in the handler code (refer to undeclared variable "a", for instance)
      7. Emit the signal in your C++ code

      Expected results:

      • JS error gets logged to console (ReferenceError: Can't find variable: a)

      Actual results:

      • JS error does not get to logged (javaScriptConsoleMessage callback does not get called)

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

            annulen Konstantin Tokarev
            a.a.kalugin Alex Kalugin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes