I guess the simplest way to explain my problem is this: I want to create a preview of another page using the WebView element, however, I need to inject some basic things like CSS and JS libraries (i.e. jQuery and MaterializeCSS). My current attempt uses a function which is provided with some identifier for jQuery to use to get the element and then I attempt to go from there.
At that point, I call
addEventListener('did-start-loading', ...) (
head is the variable with all the basic
<head> HTML). I also tried logging in the same area, so I know the code is being called, but the head code is not being written to the WebView contents.
Anyways, the full code snippet is below. Thanks in advance!
The only thing I haven’t mentioned is that
ident is the string provided to the function in the first place, typically the WebView element’s ID.