Skip to content

Instantly share code, notes, and snippets.

@satyr
Created July 17, 2010 14:30
Show Gist options
  • Save satyr/479545 to your computer and use it in GitHub Desktop.
Save satyr/479545 to your computer and use it in GitHub Desktop.
alnumpop.uc.js
// ==UserScript==
// @name alnumpop
// @desc Provides sequential accesskeys to History/AllTabs popup.
// @compat Fx4+
// @author satyr
// @include main
// ==/UserScript==
[ document.getElementById('backForwardMenu')
, document.getElementById('alltabs-popup')
].forEach
(function(p){ p.addEventListener('popupshown', this, false) }
,function alnumpop(){
var n = -1
Array.some(this.children, function(mi){
if(mi.tagName != 'menuitem' || mi.id == 'menu_tabview') return
if(++n > 35) return true
var key = n < 26 ? (n+10).toString(36).toUpperCase() : (n-15) % 10
mi.setAttribute('label', key +' '+ mi.getAttribute('label'))
mi.setAttribute('accesskey', key)
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment