mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-04 16:15:25 +00:00
38 lines
1.5 KiB
HTML
38 lines
1.5 KiB
HTML
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<script>
|
|
function pingWorker() {
|
|
var port = navigator.mozSocial.getWorker().port;
|
|
port.postMessage({topic: "flyout-message", result: "ok"});
|
|
}
|
|
window.addEventListener("socialFrameShow", function(e) {
|
|
var port = navigator.mozSocial.getWorker().port;
|
|
port.postMessage({topic: "flyout-visibility", result: "shown"});
|
|
}, false);
|
|
window.addEventListener("socialFrameHide", function(e) {
|
|
var port = navigator.mozSocial.getWorker().port;
|
|
port.postMessage({topic: "flyout-visibility", result: "hidden"});
|
|
}, false);
|
|
window.addEventListener("socialTest-MakeWider", function(e) {
|
|
document.body.setAttribute("style", "width: 500px;");
|
|
document.body.offsetWidth; // force a layout flush
|
|
var evt = document.createEvent("CustomEvent");
|
|
evt.initCustomEvent("SocialTest-DoneMakeWider", true, true, {});
|
|
document.documentElement.dispatchEvent(evt);
|
|
}, false);
|
|
window.addEventListener("socialTest-CloseSelf", function(e) {
|
|
window.close();
|
|
var evt = document.createEvent("CustomEvent");
|
|
evt.initCustomEvent("SocialTest-DoneCloseSelf", true, true, {});
|
|
document.documentElement.dispatchEvent(evt);
|
|
}, false);
|
|
</script>
|
|
</head>
|
|
<body style="max-width: 250px;" onload="pingWorker();">
|
|
<p>This is a test social flyout panel.</p>
|
|
<a id="traversal" href="http://mochi.test">test link</a>
|
|
</body>
|
|
</html>
|
|
|