Created
February 17, 2012 13:56
-
-
Save da2x/1853567 to your computer and use it in GitHub Desktop.
Platform dependant toolbar icon for Opera extensions
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
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