Detect Popup Blocker
2008-10-13 14:48:22
Category: javascript:general
Description: Test to see if the users browsers is blocking pop up windows.
Author: detour
Viewed: 2203
Rating: (10 votes)


<html>
<head></head>
 
<body>
<script language="javascript">
 
// Return true if unable to open a new window
function popup_blocked() {
  var popup = window.open('','_blank','toolbar=no,scrollbars=no');
  if (!popup) {
    return true;
  } else {
    popup.close();
    return false;
  }
}
 
if(popup_blocked()) {
  alert('Popup blocker detected.');
} else {
  alert('No popup blocker detected.');
}
</script>
 
</body>
</html>