# Working Around Asynchronous Popups

Asynchronous ads and popups are becoming more common on commerce sites. Many of the dialogs can be closed by simply re-forcing focus back to the main portion of the page.

Manually adding a focus step prior to each action in places where a modal popup may appear, ensures you can gracefully continue without error or interruption.

# Example

The following site always displays a modal, at an unpredicted time. The site however discontinues trying to display once the user leaves the main page. The focus action is used prior to the planned action to ensure the planned action occurs without error.

This can be accomplished in one of two ways:

## Approach 1: Using Two Separate Steps

 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/ZbvxUTsqgQJTN1bG-1c3f73bbcdcf.png)

## Approach 2: Using eval()

 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/Tt9LPAZdwHXuTMpx-81e7ca8c8103.png)

## Sample Designer Script

<span>[](../../../Resources/Images/GeneralGraphics/shopping_checkForModal.ds)</span>

<div id="bkmrk-last-updated%3A-july-0">---

Last updated: <span class="mc-variable General.NewDateTimeVariable variable">July 03, 2023</span>

If you have any feedback on this topic, please contact us at <documentation@appvance.ai>

</div>