Is it possible to expose a function so it can be called manually via console?

say I want to implement extra functionality on a website without adding extra buttons to the page. how can I expose a function that can interact with signals, etc. and is callable via the browser console or userscript so that users can "hack" the page and make use of that functionality?
2 Replies
Alex Lohr
Alex Lohr12mo ago
window._setName = setName; The underscore is not necessary, but it helps to avoid conflicts.
im_ninooo
im_ninooo12mo ago
oh. 🤦‍♂️ yeah that was a pretty obvious one. thank you!