user1767586 user1767586 - 5 months ago 48
Javascript Question

Popup without user action?

How is this site triggering its popup while bypassing Chrome's pop-up blocker?

http://undertexter.se/

I thought pop-up blockers only allowed window.open if it was triggered by a user action but that's not the case here so how are they doing it?

Answer

Tested on my own server, This opens up http://google.com in a new (standalone) window in Chromium 28 on Ubuntu 12.04. Adblock is active.

<script type="text/javascript">
document.addEventListener('click', function() {
    window.open('http://google.com','...','width=1080 height=640')
})
</script>