JavaScript with custom Widgets

It is actually possible, but it is undocumented, not officially supported, and discouraged.

In this case, there are almost certainly better options. Depending on what capabilities the script requires the most native solution would just be to recreate the file as an OH script and have the toggle component trigger the oh script.

2 Likes