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 | <body> |
michael@0 | 3 | |
michael@0 | 4 | <script> |
michael@0 | 5 | |
michael@0 | 6 | var numPrompts = 0; |
michael@0 | 7 | function handlePrompt(e) { |
michael@0 | 8 | numPrompts++; |
michael@0 | 9 | |
michael@0 | 10 | // The first two prompts should be "child1:ready" and "child2:ready". Once |
michael@0 | 11 | // we get both of these, forward the child's prompt up to our parent. |
michael@0 | 12 | if (numPrompts == 2) { |
michael@0 | 13 | // This has to happen here, because setVisibile doesn't exist on the iframe |
michael@0 | 14 | // until BrowserElementChild.js is loaded in it. (That's pretty broken...) |
michael@0 | 15 | iframe2.setVisible(false); |
michael@0 | 16 | } |
michael@0 | 17 | else if (numPrompts == 3) { |
michael@0 | 18 | if (e.detail.message != 'child2:hidden') { |
michael@0 | 19 | alert("parent:fail Didn't get expected 'child2:hidden'."); |
michael@0 | 20 | } |
michael@0 | 21 | |
michael@0 | 22 | alert('parent:ready'); |
michael@0 | 23 | } |
michael@0 | 24 | else if (numPrompts == 4 || numPrompts == 5) { |
michael@0 | 25 | alert(e.detail.message); |
michael@0 | 26 | } |
michael@0 | 27 | } |
michael@0 | 28 | |
michael@0 | 29 | var iframe1 = document.createElement('iframe'); |
michael@0 | 30 | iframe1.setAttribute("mozbrowser", "true"); |
michael@0 | 31 | iframe1.addEventListener('mozbrowsershowmodalprompt', handlePrompt); |
michael@0 | 32 | |
michael@0 | 33 | var iframe2 = document.createElement('iframe'); |
michael@0 | 34 | iframe2.setAttribute("mozbrowser", "true"); |
michael@0 | 35 | iframe2.addEventListener('mozbrowsershowmodalprompt', handlePrompt); |
michael@0 | 36 | |
michael@0 | 37 | iframe1.src = 'file_browserElement_SetVisibleFrames_Inner.html?child1'; |
michael@0 | 38 | iframe2.src = 'file_browserElement_SetVisibleFrames_Inner.html?child2'; |
michael@0 | 39 | document.body.appendChild(iframe1); |
michael@0 | 40 | document.body.appendChild(iframe2); |
michael@0 | 41 | |
michael@0 | 42 | </script> |
michael@0 | 43 | |
michael@0 | 44 | </body> |
michael@0 | 45 | </html> |