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 class="reftest-wait">
3 <head>
4 <script>
7 function init1()
8 {
9 targetIframe = document.createElementNS('http://www.w3.org/1999/xhtml', 'iframe');
10 targetIframe.src = "data:text/html,";
11 targetIframe.setAttribute("style", "width: 300px; height: 200px; border: 1px dotted green;");
12 targetIframe.addEventListener("load", init2, false);
13 document.body.appendChild(targetIframe);
14 }
17 function init2()
18 {
19 targetWindow = targetIframe.contentWindow;
20 targetDocument = targetWindow.document;
22 var div = document.getElementById("div");
23 textNode = div.firstChild;
25 targetDocument.body.appendChild(targetDocument.adoptNode(div, true));
27 targetDocument.designMode = 'on';
28 setTimeout(init3, 0);
29 }
32 function init3()
33 {
34 var rng = targetDocument.createRange();
35 rng.setStart(textNode, 1);
36 rng.setEnd(textNode, 1);
37 targetWindow.getSelection().addRange(rng);
39 try {
40 targetDocument.execCommand("inserthtml", false, "<p>");
41 } catch(e) {}
43 document.documentElement.removeAttribute("class");
44 }
47 </script>
49 </head>
51 <body onload="init1();">
53 <div id="div"> </div>
55 <script>
56 </script>
57 </body>
58 </html>