Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save gialloporpora/11291598 to your computer and use it in GitHub Desktop.

Select an option

Save gialloporpora/11291598 to your computer and use it in GitHub Desktop.
This code add an hotkey to switch from View Watched Thread with Unread and All Thread in Thunderbird using userChrome.js add-on.
if (location == "chrome://messenger/content/messenger.xul") {
/* Aggiungo l'accel text nella voce di menu */
document.getElementById('viewWatchedThreadsWithUnreadMenuItem').setAttribute('acceltext', 'Maiusc+W');
/* Seleziono il main keyset dove sono inserite le scorciatoie da tastiera */
let ks = document.getElementById('mailKeys');
/* Creo una nuova chiave */
let nk = document.createElement('key');
nk.setAttribute('id', 'key_viewwatchedthreadwithunread');
nk.setAttribute('modifiers','shift');
nk.setAttribute('keycode', 'w');
nk.setAttribute("oncommand", "if (gFolderDisplay.view.specialView) goDoCommand('cmd_viewAllMsgs'); else goDoCommand('cmd_viewWatchedThreadsWithUnread');");
ks.appendChild(nk);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment