Is there a way for themes to call a function when sodo search is activated?

I am trying to change the placeholder text in the search input with:

document.getElementById("sodo-search-root").querySelector("iframe").contentWindow.document.querySelector("input").placeholder = "New placeholder text"

… but as far as I can tell these elements don’t exist at the time of window.onload.

Is there a built-in way to call a function when search is opened that I am missing — or should I add my own event listeners for when the search button is clicked / ctrl+k is pressed?

Thanks!