Skip to content

Instantly share code, notes, and snippets.

@scottferg
Created September 1, 2009 20:10
Show Gist options
  • Save scottferg/179342 to your computer and use it in GitHub Desktop.
Save scottferg/179342 to your computer and use it in GitHub Desktop.
// In your toolstrip JS onClick event
var port chrome.self.connect();
port.postMessage({array:of, some:elements});
// In your content-script
// Event handler that listens for responses from
// the extension
chrome.extension.onConnect().addListener(function(port) {
port.onMessage.addListener( function( data ) {
// Data is the response, resize your window here
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment