dom/tests/mochitest/localstorage/frameAppIsolation.html

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 <html xmlns="http://www.w3.org/1999/xhtml">
     2 <head>
     3   <title>slave for app isolation test</title>
     4   <script type="text/javascript">
     5   var success = false;
     7   var action = window.location.search.substring(1);
     9   switch (action) {
    10     case "read-no":
    11       if (localStorage.getItem("0") == null) {
    12         success = true;
    13       }
    14       break;
    15     case "write":
    16       localStorage.setItem("0", "foo");
    17       success = true;
    18       break;
    19     case "read-yes":
    20       if (localStorage.getItem("0") == "foo") {
    21         success = true;
    22       }
    23       break;
    24     case "clear":
    25       localStorage.clear();
    26       success = true;
    27       break;
    28   }
    29   success ? alert("success") : alert("failure");
    30   </script>
    31 </head>
    33 <body>
    34 </body>
    35 </html>

mercurial