Thu, 15 Jan 2015 15:59:08 +0100
Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | <?xml version="1.0"?> |
michael@0 | 2 | |
michael@0 | 3 | <!-- This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | - License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> |
michael@0 | 6 | |
michael@0 | 7 | <?xml-stylesheet href="chrome://global/skin" type="text/css"?> |
michael@0 | 8 | |
michael@0 | 9 | <window id="bug586713_window" |
michael@0 | 10 | xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" |
michael@0 | 11 | width="300" |
michael@0 | 12 | height="300" |
michael@0 | 13 | onload="onLoad();" |
michael@0 | 14 | title="Bug 586713 Test"> |
michael@0 | 15 | |
michael@0 | 16 | <menubar id="nativemenubar"> |
michael@0 | 17 | <menu id="foo" label="Foo"> |
michael@0 | 18 | <menupopup> |
michael@0 | 19 | <menuitem label="FooItem0"/> |
michael@0 | 20 | </menupopup> |
michael@0 | 21 | </menu> |
michael@0 | 22 | </menubar> |
michael@0 | 23 | |
michael@0 | 24 | <script type="application/javascript"><![CDATA[ |
michael@0 | 25 | function ok(condition, message) { |
michael@0 | 26 | window.opener.wrappedJSObject.SimpleTest.ok(condition, message); |
michael@0 | 27 | } |
michael@0 | 28 | |
michael@0 | 29 | function onTestsFinished() { |
michael@0 | 30 | window.close(); |
michael@0 | 31 | window.opener.wrappedJSObject.SimpleTest.finish(); |
michael@0 | 32 | } |
michael@0 | 33 | |
michael@0 | 34 | var fooCallCount = 0; |
michael@0 | 35 | function foo() { |
michael@0 | 36 | fooCallCount++; |
michael@0 | 37 | let instruction = document.createProcessingInstruction("xml-stylesheet", 'href="chrome://foo.css" type="text/css"'); |
michael@0 | 38 | document.insertBefore(instruction, document.documentElement); |
michael@0 | 39 | if (fooCallCount == 2) { |
michael@0 | 40 | ok(true, "If we got here we didn't crash, excellent."); |
michael@0 | 41 | onTestsFinished(); |
michael@0 | 42 | } |
michael@0 | 43 | } |
michael@0 | 44 | |
michael@0 | 45 | function onLoad() { |
michael@0 | 46 | foo(); |
michael@0 | 47 | setTimeout(function() foo(), 0); |
michael@0 | 48 | } |
michael@0 | 49 | ]]></script> |
michael@0 | 50 | </window> |