Javascript Binding - Only call Connect for main browser (not popups)

First attempt to fix #614