Added support for JS callback before opening page to fix #282