Skip to content

Instantly share code, notes, and snippets.

@scottferg
Forked from wmbest2/Manifest.json
Created September 1, 2009 20:27
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 scottferg/179362 to your computer and use it in GitHub Desktop.
Save scottferg/179362 to your computer and use it in GitHub Desktop.
{
"name": "Sizerator",
"version": "1.0",
"description": "The first extension that I made.",
"toolstrips": [
"my_toolstrip.html"
],
"permissions": [
"tabs"
],
"content_scripts": [
{
"matches": ["http://*/*"],
"js": ["resizer.js"]
}
]
}
<div class="toolstrip-button" id="button">
<span>800 x 600</span>
</div>
document.getElementById("button").onclick = function() {
var port chrome.self.connect();
port.postMessage({width:800, height:600});
}
chrome.extension.onConnect().addListener(function(port) {
port.onMessage.addListener( function( data ) {
window.width = data.width;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment