[webkit-gtk] detect javascript loops

Konstantin Tokarev annulen at yandex.ru
Thu Apr 11 06:38:27 PDT 2019

11.04.2019, 16:31, "Rena" <hyperhacker at gmail.com>:
> On Thu, Apr 11, 2019, 05:34 Jérémy Lal <kapouer at melix.org> wrote:
>> Hi,
>> Does webkit(gtk) offer a way to detect client javascript that does things like that:
>> ```
>> while (true) {}
>> ```
> Look up "halting problem".

I guess question was asked about run-time detection of infinite loop, not about doing it before
execution of JS code started.

It can be manually done via Inspector, which shows if there is JS code running and allows to
pause it and see executed line of code. 

As for programmatic way, I guess that WebProcessProxy::isResponsible() should become false
if JS code is blocking main thread, but I haven't checked. It seems like this feature not exposed
in public API of WebKitGTK.


More information about the webkit-gtk mailing list