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 | <meta charset="utf-8"> |
michael@0 | 4 | <script> |
michael@0 | 5 | var testwindow; |
michael@0 | 6 | function pingWorker() { |
michael@0 | 7 | var port = navigator.mozSocial.getWorker().port; |
michael@0 | 8 | port.onmessage = function(e) { |
michael@0 | 9 | var topic = e.data.topic; |
michael@0 | 10 | switch (topic) { |
michael@0 | 11 | case "test-flyout-open": |
michael@0 | 12 | navigator.mozSocial.openPanel("social_flyout.html"); |
michael@0 | 13 | break; |
michael@0 | 14 | case "test-flyout-close": |
michael@0 | 15 | navigator.mozSocial.closePanel(); |
michael@0 | 16 | break; |
michael@0 | 17 | case "test-chatbox-open": |
michael@0 | 18 | var url = "social_chat.html"; |
michael@0 | 19 | var data = e.data.data; |
michael@0 | 20 | if (data && data.id) { |
michael@0 | 21 | url = url + "?id="+data.id; |
michael@0 | 22 | } |
michael@0 | 23 | navigator.mozSocial.openChatWindow(url, function(chatwin) { |
michael@0 | 24 | // Note that the following .focus() call should *not* arrange |
michael@0 | 25 | // to steal focus - see browser_social_chatwindowfocus.js |
michael@0 | 26 | if (data && data.stealFocus && chatwin) { |
michael@0 | 27 | chatwin.focus(); |
michael@0 | 28 | } |
michael@0 | 29 | port.postMessage({topic: "chatbox-opened", |
michael@0 | 30 | result: chatwin ? "ok" : "failed"}); |
michael@0 | 31 | }); |
michael@0 | 32 | break; |
michael@0 | 33 | case "test-isVisible": |
michael@0 | 34 | port.postMessage({topic: "test-isVisible-response", |
michael@0 | 35 | result: navigator.mozSocial.isVisible}); |
michael@0 | 36 | break; |
michael@0 | 37 | } |
michael@0 | 38 | } |
michael@0 | 39 | port.postMessage({topic: "sidebar-message", result: "ok"}); |
michael@0 | 40 | } |
michael@0 | 41 | </script> |
michael@0 | 42 | </head> |
michael@0 | 43 | <body onload="pingWorker();"> |
michael@0 | 44 | <p>This is a test social sidebar.</p> |
michael@0 | 45 | <button id="chat-opener" onclick="navigator.mozSocial.openChatWindow('./social_chat.html');"/> |
michael@0 | 46 | </body> |
michael@0 | 47 | </html> |