Why did I get the message "The webpage you are viewing is trying to close the window" when I clicked Continue Shopping in the PayPal shopping cart?

While using the PayPal shopping cart, you received the message "The webpage you are viewing is trying to close the window."

This is an expected behavior based on Internet Explorer 7 default security settings and some PayPal shopping cart updates to enhance tabbed browsing.

The following workaround prevents PayPal from opening a new window, thus avoiding this error.

To get the button code working on tabbed browsers, you must modify this line of your PayPal button code:

<form target="PayPal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
to this:
<form target="_self" action="https://www.paypal.com/cgi-bin/webscr" method="post">
Then add the following line, which redirects the customer to the URL you specify when he or she clicks the Continue Shopping button:
<input type="hidden" name="shopping_url" value="http://www.domain.com/WhereYouWantYourCustomersReturnedTo.html">
Here's the whole form:
<form target="_self" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="image" src="btn_cart_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt=" border="0" src="pixel.gif" width="1" height="1">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="shopping_url" value="http://www.domain.com/WhereYouWantYourCustomersReturnedTo.html">
<input type="hidden" name="business" value="email@domain.com">
<input type="hidden" name="item_name" value="test">
<input type="hidden" name="amount" value="1.00">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-ShopCartBF">

See also:
PayPal Payments Standard and Button Manager: Getting Started
Test your payment buttons