Skip to content

Instantly share code, notes, and snippets.

@jxpx777
Created February 11, 2015 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jxpx777/5ae3f3deae8fa3166bc5 to your computer and use it in GitHub Desktop.
Save jxpx777/5ae3f3deae8fa3166bc5 to your computer and use it in GitHub Desktop.
var WebSocket = null;
hiddenFrames.add(hiddenFrames.HiddenFrame({
'onReady': function () {
var self = this; // Don't use bind for `this` since GCC warns w/ "dangerous use of the global this object"
self.element.contentWindow.location = require("sdk/self").data.url("ui/hidden.html");
self.element.addEventListener("DOMContentLoaded", function () {
console.log("Initializing WebSocket for '" + self.element.contentWindow.location + "'");
//noinspection JSUnresolvedVariable
WebSocket = self.element.contentWindow.MozWebSocket || self.element.contentWindow.WebSocket;
}, true, true);
}
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment