I have been putting my hands on the emulator (RDK 2.0) and the browser is not printing the Javascript messages, including console.log() or Javascript error messages. Currently, I am trying to find the messages on the stdout of the browser execution.

So  I would like to know if it is being printed in another place? If yes, where?

 

Additional info:

The source file of the rdkbrowser at this location (https://svn3.teamccp.com/svn/rdk/rdk/releases/generic/components/comcast/rdkbrowser/trunk/rdkbrowser.cpp) explicitly addresses this question with the class JSLoggingWebPage. However, the patch introduced in the rdkemulator for the rdkbrowser (https://svn3.teamccp.com/svn/rdk/rdk/releases/devices/intel-x86-pc/comcast/rdkbrowser/trunk/rdkbrowser.patch) deletes this code.

 

Thank you for your attention

 

 

6 Comments

  1. I'll try to replicate it and get back to you.

  2. The information in "Additional Info" section is correct and the class JSLoggingWebPage got removed in the rdkbrowser patch. Hence, the observed behavior.

  3. This is an emulator specific issue and there have been several questions and requests related to the 2.0 version of the RDK Emulator.  As this exciting new tool continues to rapidly evolve and grow , our focus is to make an updated version of the emulator version available to the community as quickly as possible. With this priority in mind, we will no longer be supporting the RDK 2.0 version of the emulator.  At the recent RDK ASP Tech Summit, the new version of the RDK Emulator was demonstrated, and is projected to be available in the 3Q14 timeframe.  We will keep the RDK Wiki updated about the  upcoming RDK Emulator release, and suggest that you discontinue any effort related to the RDK Emulator 2.0.

  4. I did some digging into this the other day.  I realized that rdkbrowser is using qDebug().  You may have more success using qt debugging.

  5. Hi , 

    I am also facing similar issue, I am able to run app in chrome browser without any errors but app is not opening in RDK emulator. I was looking fo Javascript error log but unable to find it. 

     

    Can anyone help me out on how to debug the HTML/JS application on RDK emulator and where can I find the javascript error log?

     

    Thanks,

    Pankaj

  6. Caveat: I haven't tried this...

    In the rdkbrowser there is a file WebView.cpp with the following method defined:

    void JSLoggingWebPageCommon::javaScriptConsoleMessage(const QString& message, int lineNumber, const QString& sourceID)
    {
    QString filestr(" ");
    if (!sourceID.isEmpty())
    filestr = "[" + sourceID + ":" + QString::number(lineNumber) + "] ";
    qDebug().nospace() << qPrintable(QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss"))
    << " [JS Console]" << qPrintable(filestr) << qPrintable(message);
    }

    That call to qDebug() is likely to be swallowed by the Qt i/o system depending on the build flags passed to Qt. You should be able to adapt the .pro for rdkbrowser to enable Debug output [which is different to Warning, Info, etc].

    As a workaround you could revise to the call to qDebug() to stdout like this:

    QTextStream& qStdOut()
    {
    static QTextStream ts( stdout );
    return ts;
    }
    void JSLoggingWebPageCommon::javaScriptConsoleMessage(const QString& message, int lineNumber, const QString& sourceID)
    {
    QString filestr(" ");
    if (!sourceID.isEmpty())
    filestr = "[" + sourceID + ":" + QString::number(lineNumber) + "] ";
    qStdOut() << qPrintable(QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss"))
    << " [JS Console]" << qPrintable(filestr) << qPrintable(message);
    }

    This will then output the text to stdout. 

    This may conflict with your company's policy on trace output, btw.

     

    Howard