Home | History | Annotate | Download | only in policy_PopupsBlockedForUrls
      1 <!doctype html>
      2 <html lang="en">
      3 <head>
      4 <meta charset="utf-8">
      5 <title>Popup Status</title>
      6 <script type="text/javascript">
      7 var pageReady = false;
      8 
      9 function onLoad() {
     10   pageReady = true;
     11   if (isPopupBlocked()) {
     12     document.getElementById('status').innerHTML = 'Blocked.';
     13   } else {
     14     document.getElementById('status').innerHTML = 'Allowed.';
     15   }
     16 }
     17 
     18 function isPopupBlocked() {
     19   var popup_window = window.open(null, "", "width=100,height=100");
     20   try {
     21     popup_window.close();
     22     return false;
     23   }
     24   catch (e) {
     25     return true;
     26   }
     27 }
     28 </script>
     29 </head>
     30 <body onload="onLoad()">
     31 <div>Pop-ups Status: <span id="status"></span></div>
     32 </body>
     33 </html>
     34