[webkit-gtk] R: Re: R: Re: Can't find a way to implement content blocking (filtering)

linuxfan at tin.it linuxfan at tin.it
Mon May 17 22:08:21 PDT 2021


>
>A pipe would work ... few built-in options that will probably be 
easier:
>UI process -> web process:

>webkit_web_context_send_message_to_all_extensions()

Ok Michael,

I 
wrote the extension, using the message passing mechanism you suggested. 
Thanks for that. I was worried because debugging two different 
"projects" isn't as comfortable as debugging only one, moreover I don't 
use C but freepascal, with the overhead of writing by hand the 
corresponding declarations (I can not install the development packages, 
so I use basic dynamic loading of libraries).

Anyway, I would like to 
point out that, in the end, I don't believe that delegating this 
filtering in an extension brings some advantage, only some 
complication. If you think, the web process uses callbacks anyway, 
which make it slow down. It doesn't matter where the callbacks are, 
they are called synchronously and, when invoked, they run in the <page> 
thread, even if they were declared in what "seems" the <main> (or UI) 
thread. In fact, the chromium engine has many callbacks from different 
threads, but I managed them all in the same application.

Anyway, that 
is gone. Now I am fighting with the find_controller which doesn't seem 
to work, not even in the already-compiled MiniBrowser application that 
I received bundled with the webkit2gtk library (libwebkit2gtk-4.0.so.
37.49.9 on a Debian stable). I will investigate more, but it seems 
there is something wrong in the library itself.

Have a nice day, best 
regards,
linuxfan




More information about the webkit-gtk mailing list