js/xpconnect/tests/mochitest/file_bug650273.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 <!-- test by moz_bug_r_a4@yahoo.com -->
     2 <body onload="a()">
     3 <script>
     4 var targetUrl = "http://example.com/";
     5 var l;
     7 function a() {
     8         var o = {};
     9         o.toString = function() {
    10                 l();
    11                 return "a";
    12         };
    13         var f = Object.getOwnPropertyDescriptor(Document.prototype, "title").set;
    14         setTimeout(f.bind(document), 0, o);
    15 }
    17 function l() {
    18         var l = false;
    19         onunload = function() {
    20                 l = true;
    21         };
    22         location = targetUrl;
    23         do {
    24                 var r = new XMLHttpRequest();
    25                 r.open("GET", location.href, false);
    26                 r.overrideMimeType("text/plain");
    27                 try { r.send(null); }
    28                 catch (e) {}
    29         } while (!l);
    30 }
    31 </script>

mercurial