You should be ok with putting the code in the header inside an html element, then replace window.something with wwLib.getFrontWindow().something
You should be ok with putting the code in the header inside an html element, then replace window.something with wwLib.getFrontWindow().something