CSS & JS Changes in Webview

Is it possible to modify the Webview content using either css or javascript injection?

And if possible, would this feature port to Android via Mutata?

Thanks

Hi,
Initially anything supported by Kodika, it is supported also by Mutata. We try to keep both projects aligned.

The webview will load a URL or a custom HTML?

Thanks

Hi,

That’s good to know, how about css or javascript injection into the webview in order to alter a loaded URL.?

Thanks,

Hi, in our next version we are going to add a way to run a javascript function from code blocks.
If you want just to append content to an already loaded from a url this is not possible. It is possible although to add javascript or css when you load an HTML String.
Do you want to inject to a URL or to a static HTML?

Looking to inject to a URL. In general CSS changes are enough but I am assuming that this will rely on Javascript injection to append the CSS or add it in one element at a time.?

Could you please send me an example of what are you trying to do? Do you want to be able to add css styles in ? Change a div?
Also about js injection, do you want to add your own functions or call functions already exist in the JS?
In our next release, there will be support to run your own JS, so I can assume that you will be able to change also your CSS from there?

We would be looking to change a few styles in a div.

In JS we would do something like “getElementById(‘element_name’).style.display = none;” or similar. Ability to hide, show or change the colour of certain elements within the webview URL. This is not for static HTML.

Thanks

So you want to run some JS code in the webview. This will be possible in our next release with a block called Run Javascript code. I will update also this thread when released.

That’s great news. Thanks.

Hi,
Today we released version 3.3.0 and now you can run/inject your JavaScript code using the following Code Block.

image

Amazing, time to play…and learn.

1 Like