Skip to content

Conversation

@emmby
Copy link
Contributor

@emmby emmby commented Nov 20, 2025

Provide a mechanism for the user to specify optional JavaScript to add to the page without incurring all the overhead of switching to littlefs.

Example usage:

ESPUI.setCustomJS("window.onload = function(){ console.log('Hello world!'); }");

The JS is served up at /js/custom.js which is referenced from index.htm. custom.js is empty by default unless specified by the user.

Because the JS may be relatively long, the setCustomJS() function takes a const char* instead of a String& to avoid dynamic memory allocation.

Enables functionality such as emmby/WatchTower#10

@s00500
Copy link
Owner

s00500 commented Nov 24, 2025

this looks pretty sweet, is it ready for review yet ?

@emmby
Copy link
Contributor Author

emmby commented Nov 24, 2025

Yes, ready for review!

Copy link
Owner

@s00500 s00500 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks for your contribution

@s00500 s00500 merged commit 415bc52 into s00500:master Nov 26, 2025
@emmby emmby mentioned this pull request Nov 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants