Created attachment 420028 [details] Example web process extension source Using a custom WebKitScriptWorld in a web process extension never triggers the “window-object-cleared” signal. This can be verified with a simple web process extension like the attached one (“ext.c”). To reproduce the issue: 1. Build the example extension: $CC -shared -o libext.so ext.c \ $(pkg-config --libs --cflags wpe-web-extension-1.0) 2. The run Cog passing the path to the directory containing the built “libext.so” file: cog -P fdo --web-extensions-dir="$(pwd)" ddg.gg The expected (correct) output should include the following two lines: ** Message: 19:17:26.517: --> on_window_object_cleared ** Message: 19:17:26.517: <-- on_window_object_cleared Building the extension with “-DHACK_FOR_CUSTOM_SCRIPT_WORLD” will use a workaround that GNOME Web is currently using, see: https://gitlab.gnome.org/GNOME/epiphany/-/blob/8f833666c384a9c9f5d376ff15595e8bbece90a3/embed/web-process-extension/ephy-web-process-extension.c#L234 Current trunk and stable versions of WebKit (2.30.x, both GTK and WPE ports) do *not* need the workaround when using the default WebKitScriptWorld.
This is happening for default script world too.
Created attachment 430573 [details] Patch
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See https://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Committed r278548 (238546@main): <https://commits.webkit.org/238546@main>
<rdar://problem/78938532>