summaryrefslogtreecommitdiffstats
path: root/browser/base/content/test/popups/popup_blocker_frame.html
blob: e29452fb638611dce2c1ff33d35d083b8c024466 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!doctype html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Page with iframe that contains page that opens two popups</title>
  </head>
  <body>
    <iframe id="iframe"></iframe>
    <script type="text/javascript">
      let params = new URLSearchParams(location.search);
      let base = params.get('base') || location.href;
      let frame = document.getElementById('iframe');

      function addPopupOpeningFrame() {
        frame.src = new URL("popup_blocker.html", base);
      }

      if (params.get('delayed') !== 'true') {
        addPopupOpeningFrame();
      } else {
        addEventListener("message", () => {
          addPopupOpeningFrame();
        }, {once: true});
      }
    </script>
  </body>
</html>