This is a Javascript library to pop a URL as a new window. If possible, the pop window will under the current window (AKA, pop-under). The pop will happen automatically or after a click event.

Download and unzip Pop under library 1.0.0 to the desired location on your website, let's say /js

Put the following code to the very end of page you to pop URL. Replace the url variable and javascript location accordingly.

<script async defer src="/js/show-promote.min.js"></script>
<script>
var popURL = "//google.com";
function onPopUnderLoaded() {
    this.pop(popURL);
}
</script>
                    

pop(popURL)

Try to pop the URL by the given popURL parameter.

frequency(num, hours)

Set the pop frequency. The default of unlimited.

num: How many times can pop in the duration given by hours parameter. -1 for unlimited pop.

hours: The time span in hours for limited pop number to num parameter. Default to be 24. Set to 0 for per browser session.

useTabUnder(allow)

Use tab under instead of pop up

onPop(callback)

Call the callback function after the URL was popped.