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

Maurizio, thank you for your code!
I’ve found a way without setTimeout:

<script>
    document.onreadystatechange = () => {
        if (document.readyState === "complete") {
            document.querySelector('.gh-navigation-actions > button').addEventListener('click', function() {
                const iframe = document.getElementById('sodo-search-root').querySelector('iframe');
                iframe.onload = function() {
                    iframe.contentWindow.document.querySelector('input').placeholder = 'New placeholder text';
                };
            });
        }
    };
</script>

1 Like