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 <head>
4 <script>
6 function boom()
7 {
8 var root = document.documentElement;
10 while (root.firstChild) { root.removeChild(root.firstChild); }
12 var body = document.createElementNS("http://www.w3.org/1999/xhtml", "body");
13 var div = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
14 root.contentEditable = "true";
15 root.appendChild(div);
16 root.removeChild(div);
17 root.insertBefore(body, root.firstChild);
19 window.getSelection().removeAllRanges();
20 var r0 = document.createRange();
21 r0.setStart(body, 0);
22 r0.setEnd(body, 0);
23 window.getSelection().addRange(r0);
24 var r1 = document.createRange();
25 r1.setStart(div, 0);
26 r1.setEnd(div, 0);
27 window.getSelection().addRange(r1);
29 document.execCommand("inserthtml", false, "1");
30 }
32 </script>
33 </head>
35 <body onload="boom();"></body>
36 </html>