[webkit-gtk] detect javascript loops

Carlos Garcia Campos cgarcia at igalia.com
Thu Apr 11 06:55:09 PDT 2019


El jue, 11-04-2019 a las 15:47 +0200, Jérémy Lal escribió:
> 
> 
> Le jeu. 11 avr. 2019 à 15:38, Konstantin Tokarev <annulen at yandex.ru>
> a écrit :
> > 
> > 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.
> 
> Yes that's what i meant. Something to get a similar feature as in
> other browsers:
> "something is blocking page execution..." etc...
> Of course it might sometimes be wrong so it's not something that
> would kill all without asking first.
> 
> It's also of interest when doing headless stuff with webkitgtk and
> detect something's wrong.
> Would it be easy to expose as public api ?

Yes, there's a feature to kill web processes in those cases, similar to
what happens with web processes consuming too much memory. We plan to
add support for it this release cycle, see:

https://bugs.webkit.org/show_bug.cgi?id=194444

> Jérémy
> 
> _______________________________________________
> webkit-gtk mailing list
> webkit-gtk at lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-gtk
-- 
Carlos Garcia Campos
http://pgp.rediris.es:11371/pks/lookup?op=get&search=0xF3D322D0EC4582C3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <http://lists.webkit.org/pipermail/webkit-gtk/attachments/20190411/0420ea32/attachment.bin>


More information about the webkit-gtk mailing list