Skip to content

Instantly share code, notes, and snippets.

@da2x
Created February 17, 2012 13:56
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 da2x/1853567 to your computer and use it in GitHub Desktop.
Save da2x/1853567 to your computer and use it in GitHub Desktop.
Platform dependant toolbar icon for Opera extensions
var toolbarButton, toolbarButtonProperties;
function createToolbarButton()
{
var toolbarIcon = ((~window.navigator.platform.indexOf('Mac')) ? 'macIcon.png' : 'otherIcon.png') ;
toolbarButtonProperties = {
disabled: true,
icon: toolbarIcon,
onclick: buttonClickHome,
title: 'Site Home'
},
toolbarButton = opera.contexts.toolbar.createItem(toolbarButtonProperties);
opera.contexts.toolbar.addItem(toolbarButton);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment