I saw some websites open new tab on paypal button click. I'm trying to implement the same behaviour but cannot find the way how to do that. It always opens the pop-up on the same page. Is there a way of doing it with JavaScript intagration.
The method I use https://developer.paypal.com/docs/checkout/#
If you go by the link above and click on paypal button (demo example) it will open a popup where you do your payment and then it closes. I want the same to happen in new tab instead of popup.
You would need to not integrate with the PayPal Checkout JS, and instead create your own button and write your own JS to open the Orders V2 API redirect_url in a new tab when your button is clicked.
There is no reason you should want to do this, however. The popup is in fact a better, modern "in context" experience that keeps your site open and loaded in the background. It is in fact more user-friendly in this respect. I remember from the days when this popup was first released, PayPal spent spent a lot of effort getting the experience right and making sure it performed better, i.e. resulted in more users going through with and completing the checkout, than going away to a new separate tab (that might be unfamiliar). You can trust PayPal on this, it's the company's bread and butter.