Skip to content

Instantly share code, notes, and snippets.

@nmaier
Created February 18, 2011 10:27
Show Gist options
  • Save nmaier/833511 to your computer and use it in GitHub Desktop.
Save nmaier/833511 to your computer and use it in GitHub Desktop.
<?xml version="1.0"?>
<?xml-stylesheet href="skin.css" type="text/css"?>
<overlay id="AppTab-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript">
<![CDATA[
window.addEventListener('load', function() {
removeEventListener('load', arguments.callee, false);
function checkforAppTab() {
if (gBrowser.selectedTab.pinned) {
document.documentElement.setAttribute('apptabselected','true');
} else {
document.documentElement.removeAttribute('apptabselected');
}
}
var container = gBrowser.tabContainer;
container.addEventListener('TabSelect', checkforAppTab, false);
container.addEventListener("TabPinned", checkforAppTab, false);
container.addEventListener("TabUnpinned", checkforAppTab, false);
}, false);
]]>
</script>
</overlay>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment