Change this line to use window.openP instead of window.open which is taken by inappbrowser