[wpe-webkit] Use WebKit-WPE Web Extensions to append custom <scipt> element to HTML DOM

Michael Pantazoglou michael.pantazoglou at oceanbluesoftware.co.uk
Tue Jul 27 00:36:46 PDT 2021


Hi all,

I have recently started working with the WebKit-WPE Web Extensions API to
develop some additional functionality for the WPE browser. In particular, I
need to 'inject' a custom <script> element to the HTML DOM *before* the
latter is loaded/processed by the WebPage/WebFrame.

As far as I have seen, the WebKit-WPE Extensions API allows for executing
custom JavaScript as well as exposing native code to JS via the JSC API, in
response to the window-object-cleared signal. However, those techniques do
not serve my needs, because my custom <script> element executes JS code
that needs the DOM document and document.documentElement to exist and be
fully populated in advance.

So, I was wondering if the WebKit-WPE Extensions API provides any other
signal that I could connect to and respond by altering the HTML DOM tree
-or the raw network reply- before it is passed to the
WebPage/WebFrame/HTMLDocumentParser. Has anybody else tried anything
similar in the past? What is the best way to move forward besides patching
WebKit itself?

Thanks and regards,
Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-wpe/attachments/20210727/93c82ab6/attachment.htm>


More information about the webkit-wpe mailing list