content/html/document/test/bug196523-subframe.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 <script>
     3   function checkDomain(str, msg) {
     4     window.parent.postMessage((str == document.domain) + ";" +msg,
     5                               "http://mochi.test:8888");
     6   }
     8   function reportException(msg) {
     9     window.parent.postMessage(false + ";" + msg, "http://mochi.test:8888");
    10   }
    12   var win1;
    13   try {
    14     win1 = window.open("", "", "width=100,height=100");
    15     var otherDomain1 = win1.document.domain;
    16     win1.close();
    17     checkDomain(otherDomain1, "Opened document should have our domain");
    18   } catch(e) {
    19     reportException("Exception getting document.domain: " + e);
    20   } finally {
    21     win1.close();
    22   }
    24   document.domain = "example.org";
    26   var win2;
    27   try {
    28     win2 = window.open("", "", "width=100,height=100");
    29     var otherDomain2 = win2.document.domain;
    30     checkDomain(otherDomain2, "Opened document should have our domain");
    31     win2.close();
    32   } catch(e) {
    33     reportException("Exception getting document.domain after domain set: " + e);
    34   } finally {
    35     win2.close();
    36   }
    37 </script>

mercurial