Important: Please read the Qt Code of Conduct -

How to disable Javascript timers throttling in Qt 5.12?

  • I am using a QWebEngineView to load a local html file in my Qt application. This html file contains some Javascript timers (setInterval and setTimeout). When I compiled my app with Qt 5.11.2, I could set the timers to have a short interval smaller than 1s, for example 200ms.

    When I compile the app with Qt 5.12.0 or Qt 5.12.1, the timers are fired every 1s even if I specify a smaller interval.

    The following code is supposed to log something every 200ms, but it is executed only once per second (1000ms).

    const intv = setInterval(() => console.log(new Date().getTime()), 200);

    The same is true for other timer-related functions (e.g. setTimeout).

    Does anyone know if some kind of throttling has been added to QWebEngine? Or to Chromium?
    Is there any way to disable this restriction?


Log in to reply