Skip to content

Instantly share code, notes, and snippets.

@tgvashworth
Created July 3, 2012 11:11
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 tgvashworth/3039124 to your computer and use it in GitHub Desktop.
Save tgvashworth/3039124 to your computer and use it in GitHub Desktop.
extensio UI API
/*
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!'
}
]
}
@tgvashworth
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment