1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20

fuchsia_web / webengine / test / data / popup_parent.html [blame]

<html>
  <head><title>Popup parent</title></head>
  <body>
    <script>
      function getChildUrl(parentUrl) {
        const search_string = "?child_url=";

        let index = parentUrl.indexOf(search_string);
        if (index <= 0) {
          document.title = 'FAILED: No child URL specified'
          return document.title;
        }
        
        return parentUrl.substring(index + search_string.length);
      }

      window.open(getChildUrl(window.location.href));
    </script>
  </body>
</html>