Created
May 23, 2014 22:00
-
-
Save wbamberg/f9fa87e8712d86ba0543 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const data = require("sdk/self").data; | |
const tabs = require("sdk/tabs"); | |
var { ToggleButton } = require("sdk/ui/button/toggle"); | |
var button = ToggleButton({ | |
id: "reddinator", | |
label: "Reddinator", | |
icon: { | |
"16": "./red-16.png", | |
"32": "./red-32.png" | |
}, | |
onChange: handleChange | |
}); | |
function handleChange(state) { | |
worker = tabs.activeTab.attach({ | |
contentScriptFile: data.url("reddinate.js") | |
}); | |
// pass the message on to the active tab's content script | |
worker.postMessage("a"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment