[Webkit-unassigned] [Bug 238598] [WPE][GTK] Missing API to pass client-side messages to new pages on the web extension side

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Apr 22 04:09:41 PDT 2022


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

--- Comment #1 from Pablo Saavedra <psaavedra at igalia.com> ---
This proposal that comes after a conversation with  aperez (igalia.com):


We could add a new signal in the webview. There is a `didReceiveSynchronousMessageFromInjectedBundle()`, when the webprocess sends a sync message to the uiprocess it will pause waiting for a reply. We could send a sync message whenever a new page is created (new page in webprocess = new page load). It would be like this:

1. When a WebKitWebPage is going to be created (which happens for every new load), send a sync message to the UIProcess.
2. In the UIProcess, receive the message, emit signal WebKitWebView::configure-web-extension-page (maybe not the best name) that it runs once per WebKitWebPage
3. If a signal handler for the signal returns a GVariant, send it back as response to the sync message.
4. Back in the WebProcess, if a GVariant is received, assign it to the WebKitWebPage.initialization-data property.
5. Emit WebKitWebExtension::page-created normally. Signal handlers in webprocess extensions can read the data returned in (2.) using the WebKitPage.initialization-data property at this point, before the load starts, or even later when WebKitScriptWorld::window-object-cleared is emitted (because signal handlers for this signal receive the WebKitWebPage, too)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220422/8fb15b7b/attachment.htm>


More information about the webkit-unassigned mailing list