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> |
michael@0 | 2 | <head> |
michael@0 | 3 | <script> |
michael@0 | 4 | function createXHR() { |
michael@0 | 5 | var xhr = new XMLHttpRequest(); |
michael@0 | 6 | xhr.expando = "foo"; |
michael@0 | 7 | return xhr; |
michael@0 | 8 | } |
michael@0 | 9 | |
michael@0 | 10 | function tryToUseXHR(xhr, ok) { |
michael@0 | 11 | function expectException(op, reason) { |
michael@0 | 12 | try { |
michael@0 | 13 | var result = op(); |
michael@0 | 14 | ok(false, "should have thrown an exception, got: " + result); |
michael@0 | 15 | } catch (e) { |
michael@0 | 16 | ok(/Permission denied/.test(e.toString()), reason); |
michael@0 | 17 | } |
michael@0 | 18 | } |
michael@0 | 19 | |
michael@0 | 20 | expectException(function() { xhr.open(); }, "should not have access to any functions"); |
michael@0 | 21 | expectException(function() { xhr.foo = "foo"; }, "should not be able to add expandos"); |
michael@0 | 22 | expectException(function() { xhr.withCredentials = true; }, "should not be able to set attributes"); |
michael@0 | 23 | } |
michael@0 | 24 | </script> |
michael@0 | 25 | </head> |
michael@0 | 26 | <body> |
michael@0 | 27 | </body> |
michael@0 | 28 | </html> |