Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | <html xmlns="http://www.w3.org/1999/xhtml"> |
michael@0 | 2 | <head> |
michael@0 | 3 | <script> |
michael@0 | 4 | <![CDATA[ |
michael@0 | 5 | |
michael@0 | 6 | var i = 0; |
michael@0 | 7 | |
michael@0 | 8 | function init() |
michael@0 | 9 | { |
michael@0 | 10 | targetWindow = window.frames[0]; |
michael@0 | 11 | targetDocument = targetWindow.document; |
michael@0 | 12 | targetDocument.body.appendChild(targetDocument.importNode(document.getElementById('rootish'), true)); |
michael@0 | 13 | targetDocument.designMode = 'on'; |
michael@0 | 14 | setTimeout(boom, 30); |
michael@0 | 15 | } |
michael@0 | 16 | |
michael@0 | 17 | function boom() |
michael@0 | 18 | { |
michael@0 | 19 | var r = targetDocument.createRange(); |
michael@0 | 20 | r.setStart(targetDocument.getElementById("bar"), 0); |
michael@0 | 21 | r.setEnd(targetDocument.getElementById("baz").firstChild, 0); |
michael@0 | 22 | targetWindow.getSelection().addRange(r); |
michael@0 | 23 | targetDocument.execCommand("indent", false, null); |
michael@0 | 24 | setTimeout(whack, 300); |
michael@0 | 25 | } |
michael@0 | 26 | |
michael@0 | 27 | function whack() |
michael@0 | 28 | { |
michael@0 | 29 | if (++i > 100) return; |
michael@0 | 30 | document.documentElement.style.MozBinding = 'url("data:text/xml,' + encodeURIComponent("<bindings xmlns=\"http://www.mozilla.org/xbl\"><binding id=\"foo\" g=\""+Math.random()+"\"><content>\n<\/content><\/binding><\/bindings>\n") + '")'; |
michael@0 | 31 | setTimeout(bonk, 10); |
michael@0 | 32 | } |
michael@0 | 33 | |
michael@0 | 34 | function bonk() |
michael@0 | 35 | { |
michael@0 | 36 | document.getElementById("i").style.MozBinding = 'url("data:text/xml,' + encodeURIComponent("<bindings xmlns=\"http://www.mozilla.org/xbl\"><binding id=\"foo\" g=\""+Math.random()+"\"><content>\n\n<\/content><\/binding><\/bindings>\n") + '")'; |
michael@0 | 37 | document.documentElement.style.MozBinding = 'url("data:text/xml,' + encodeURIComponent("<bindings xmlns=\"http://www.mozilla.org/xbl\"><binding id=\"foo\" g=\""+Math.random()+"\"><content><iframe xmlns=\"http://www.w3.org/1999/xhtml\" src=\"data:text/html,\" style=\"width: 95%; height: 500px;\"><\/iframe><\/content><\/binding><\/bindings>\n") + '")'; |
michael@0 | 38 | setTimeout(whack, 10); |
michael@0 | 39 | } |
michael@0 | 40 | |
michael@0 | 41 | ]]> |
michael@0 | 42 | </script> |
michael@0 | 43 | </head> |
michael@0 | 44 | |
michael@0 | 45 | <body onload="init()"> |
michael@0 | 46 | |
michael@0 | 47 | <iframe id="i" src="data:text/html," style="width: 95%; height: 500px;"/> |
michael@0 | 48 | |
michael@0 | 49 | <div id="rootish"> |
michael@0 | 50 | <div>Foo</div> |
michael@0 | 51 | <div id="bar">Bar</div> |
michael@0 | 52 | <div><select><option id="baz">baz</option></select></div> |
michael@0 | 53 | </div> |
michael@0 | 54 | |
michael@0 | 55 | </body> |
michael@0 | 56 | </html> |