Fixed bridge to work even after a redirect triggered from javascript