switched to javascript event listeners, using capture mode, so it hopefully fires before page
was working on detatched head