Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

feat: JS-Engine (off-screen web-"view")

75 views
Skip to first unread message

Ricardo “Rudxain” Fernández Serrata

unread,
Dec 30, 2024, 8:58:32 PM12/30/24
to Automate for Android

Ricardo “Rudxain” Fernández Serrata

unread,
Dec 30, 2024, 9:00:58 PM12/30/24
to Automate for Android
This allows execution of JavaScript without showing a Web Dialog

On Monday, December 30, 2024 at 9:58:32 PM UTC-4 Ricardo “Rudxain” Fernández Serrata wrote:
https://developer.android.com/develop/ui/views/layout/webapps/jsengine

Henrik "The Developer" Lindqvist

unread,
Dec 31, 2024, 11:04:25 AM12/31/24
to Automate for Android
What would you it for, a usage example?

Ricardo “Rudxain” Fernández Serrata

unread,
Jan 7, 2025, 9:59:56 PMJan 7
to Automate for Android

Although, in that particular case, it's fine to show the dialog.
But if it was a background flow that generated random wallpapers, it would be impossible without 3rd-party apps like Termux. Unless I somehow implemented a PNG encoder using pure blocks, or as a shell-script.

Yes, BMP encoders are easier to implement, but they are extremely bad at compression.

IDK if JSEngine exposes the Canvas API, but even if it doesn't it would be easy to import a PNG encoder from a CDN.

In general, JSEngine is very useful for any sort of "pure" data-processing (doesn't require Android APIs)

Ricardo “Rudxain” Fernández Serrata

unread,
Jan 7, 2025, 10:11:10 PMJan 7
to Automate for Android
There's also this contrived example: https://llamalab.com/automate/community/flows/40412

Henrik "The Developer" Lindqvist

unread,
Jan 8, 2025, 10:17:54 AMJan 8
to Automate for Android
I'm hesitant to implement support for some other "programming language" since the novice users will have to learn that as well to understand what a flow is doing.
I may consider allowing JavaScript as a way for "headless" scraping/automation of websites using it, i.e. in the background without having a visible browser dialog.
But if so, then JSEngine probably lack the network/DOM parts anyway, and it's Android 8+ only.

As for you first usage example, the Image load block supporting SVG is on the to-do list.

Ricardo “Rudxain” Fernández Serrata

unread,
Jan 8, 2025, 3:01:44 PMJan 8
to Automate for Android
Understandable. And JS has many quirks!

The "headless" browser thing seems like a good idea.

The SVG thing would be cool, too. I expect it would be complicated to implement, because it needs to be parsed and rendered at some arbitrary resolution
Reply all
Reply to author
Forward
0 new messages