Sat, 03 Jan 2015 20:18:00 +0100
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 <body>
4 <script type="application/javascript">
6 function ok(what, msg) {
7 window.parent.postMessage({type: what ? 'OK' : 'KO', msg: msg }, '*');
8 }
10 window.addEventListener('message', receiveMessage, false);
11 function receiveMessage(evt) {
12 if (evt.data.type == 'PORT') {
13 var port = evt.data.port;
14 var counter = 0;
15 port.onmessage = function(evt) {
16 if (counter++ == 0) {
17 ok(!(evt.data % 2), "The number " + evt.data + " has been received correctly by the iframe");
19 window.parent.postMessage({ type: 'PORT', port: port }, '*', [port]);
20 }
21 else {
22 ok(false, "Wrong message!");
23 }
24 }
25 } else {
26 ok(false, "Unknown message");
27 }
28 }
30 </script>
31 </body>
32 </html>