js/xpconnect/tests/mochitest/file_expandosharing.html

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 <!DOCTYPE html>
     2 <html>
     3 <head>
     4 <script type="application/javascript">
     5   function setup() {
     6     // Set up different target objects for expandos, one for each binding type.
     7     window.targetWN = window;
     8     window.targetDOM = new XMLHttpRequest();
     9     window.targetJS = new Date();
    10   }
    12   function placeExpando(name, val, target) {
    13     target[name] = val;
    14   }
    16   // If val === null, then we shouldn't have access.
    17   function checkExpando(name, val, target, msg) {
    18     if (val !== null) {
    19       ok(name in target, msg);
    20       try {
    21         is(target[name], val, "Got the right expando value");
    22       } catch(e) { ok(false, "Threw when accessing same-origin expando"); }
    23     }
    24     else {
    25       ok(!(name in target), msg);
    26     }
    27   }
    29 </script>
    30 </head>
    31 <body onload="setup();">
    32     <span>Salut, Ma Cherise. ;-)</span>
    33 </body>
    34 </html>

mercurial