summaryrefslogtreecommitdiffstats
path: root/chrome/test/data/onunload_cookie.html
blob: 0a7de8d5263bd1450f8eb79c68e01138affca4b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<html> 
  <head>
    <title>Loading...</title>
  </head>
  <body onload="attachUnloadListener()"> 
    <script> 
      function attachUnloadListener() {
        window.addEventListener('unload', onUnload, false);
        document.title = "set cookie on unload";
      }

      function onUnload() {
        document.cookie = "onunloadCookie=foo";
      }
    </script> 
    <p>Navigate to another page to set cookie</p>
  </body> 
</html>