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 <html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
2 <head>
3 <script>
4 <![CDATA[
6 function init()
7 {
8 setTimeout(function()
9 {
10 targetWindow = window.frames[0];
11 targetDocument = targetWindow.document;
12 targetDocument.body.appendChild(targetDocument.importNode(document.getElementById('rootish'), true));
13 targetDocument.designMode = 'on';
14 setTimeout(boom, 30);
15 }, 30);
16 }
18 function boom()
19 {
20 var r = targetDocument.createRange();
21 r.setStart(targetDocument.getElementById("bar"), 0);
22 r.setEnd(targetDocument.getElementById("baz").firstChild, 0);
23 targetWindow.getSelection().addRange(r);
25 targetDocument.execCommand("indent", false, null);
27 document.documentElement.removeAttribute("class");
28 }
30 ]]>
31 </script>
32 </head>
34 <body onload="init()">
36 <iframe src="data:text/html," style="width: 95%; height: 500px;"/>
38 <div id="rootish">
39 <div>Foo</div>
40 <div id="bar">Bar</div>
41 <div><select><option id="baz">baz</option></select></div>
42 </div>
44 </body>
45 </html>