I integrated PayPal\'s Identity API in my webpage. As usual when user clicks login with paypal
(JavaScript button) it opens a new window for login purpose. But after
You need to add the close action in your return URL (and most likely use a separate URL as the return URL with nothing but the close action in it).
Take a look at the Adaptive Payments documentation. Do a find on that page for the word close and it'll take you straight to the section that covers how to handle this.
Note: You are responsible for closing the minibrowser after PayPal redirects to the page specified in either the return or cancel URL. PayPal provides a JavaScript function that you call to close a PayPal minibrowser or lightbox.