In WPE/WebKit, I want to programmatically inject a custom
<script> element within the DOM of a loaded HTML resource, before the HTML is actually processed and loaded by the WebPage/WebFrame.
What is the easiest way to do that? Does the WebKit2 Web Extensions API provide support for such functionality, or do I have to patch the WebKit sources? Any pointers to respective documentation and/or example code are most welcome.
Source: Windows Questions C++