Skip to content

Instantly share code, notes, and snippets.

@EragonJ
Created December 16, 2013 13:30
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 EragonJ/7986936 to your computer and use it in GitHub Desktop.
Save EragonJ/7986936 to your computer and use it in GitHub Desktop.
window.navigator.mozSetMessageHandler('connection',
function onConnected(request) {
var keyword = request.keyword;
var port = request.port;
port.onmessage = function onReceivedMessage(evt) {
// this is the message you sent
var message = evt.data;
// do whatever you want to do later
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment