Created
July 3, 2012 11:11
-
-
Save tgvashworth/3039124 to your computer and use it in GitHub Desktop.
extensio UI API
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
/* | |
Trying to figure out the API for creating a toolbar button | |
How do it in each browser: | |
Chrome | |
manifest && chrome.browserAction... | |
Firefox | |
widget.Widget({...}) | |
Safari | |
Info.plist | |
| declarative | programmatic | | |
_________|_____________|______________| | |
Chrome | x | x | Must be *both* & is a bit hacky | |
Firefox | | x | | |
Safari | x | | | |
_________|_____________|______________| | |
All support multiple icons | |
*/ | |
// Programmatically | |
xio.ui.toolbarItem({ | |
... | |
}); | |
// Declarative | |
// In Safari, which requires a 'command', the command could be auto generated | |
// safari.application.addEventListener('my-item#clicked', function () { ... }); | |
{ | |
..., | |
toolbar: [ | |
{ | |
id: 'my-item', | |
icon: '/res/kitten.jpg', | |
tooltip: 'A Kitten!' | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Doing either would require some kind of offline processing to turn json into plist, but that goes against the goals of the library. Looks like this isn't possible.