Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
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 | <?xml-stylesheet href="chrome://global/skin" type="text/css"?> |
michael@0 | 3 | <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" |
michael@0 | 4 | type="text/css"?> |
michael@0 | 5 | |
michael@0 | 6 | <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> |
michael@0 | 7 | |
michael@0 | 8 | <script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"/> |
michael@0 | 9 | <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> |
michael@0 | 10 | |
michael@0 | 11 | <body xmlns="http://www.w3.org/1999/xhtml"> |
michael@0 | 12 | <p id="display"></p> |
michael@0 | 13 | <div id="content" style="display: none"/> |
michael@0 | 14 | </body> |
michael@0 | 15 | |
michael@0 | 16 | <script type="application/javascript"> |
michael@0 | 17 | function getLoadContext() { |
michael@0 | 18 | const Ci = Components.interfaces; |
michael@0 | 19 | return window.QueryInterface(Ci.nsIInterfaceRequestor) |
michael@0 | 20 | .getInterface(Ci.nsIWebNavigation) |
michael@0 | 21 | .QueryInterface(Ci.nsILoadContext); |
michael@0 | 22 | } |
michael@0 | 23 | |
michael@0 | 24 | var clipboard = Components.classes["@mozilla.org/widget/clipboard;1"] |
michael@0 | 25 | .getService(Components.interfaces.nsIClipboard); |
michael@0 | 26 | |
michael@0 | 27 | var transferable = Components.classes['@mozilla.org/widget/transferable;1'] |
michael@0 | 28 | .createInstance(Components.interfaces.nsITransferable); |
michael@0 | 29 | transferable.init(getLoadContext()); |
michael@0 | 30 | |
michael@0 | 31 | transferable.addDataFlavor("text/unicode"); |
michael@0 | 32 | transferable.setTransferData("text/unicode", document, 4); |
michael@0 | 33 | |
michael@0 | 34 | clipboard.setData(transferable, null, Components.interfaces.nsIClipboard.kGlobalClipboard); |
michael@0 | 35 | |
michael@0 | 36 | SimpleTest.ok(true, "Didn't crash setting non-text data for text/unicode type"); |
michael@0 | 37 | </script> |
michael@0 | 38 | </window> |