Hi,
I tried to use the posted keybindings script in TB 68.4.1 to replace the extension that closed the current tab with ESC.
The used oncommand
Code: Select all
"document.getElementById('tabmail').closeTab(document.popupNode);"
works if I enter it in the error console, but in the script it does not work.
I tried VK_ESCAPE, that does nothing
VK_F1 does not unbind F1, pressing F1 still opens TB help.
Code: Select all
/* Thunderbird userChrome.js */
(function () {
/* List of common chrome urls:
*
* 3pane window > chrome://messenger/content/messenger.xul
* message window > chrome://messenger/content/messageWindow.xul
* compose window > chrome://messenger/content/messengercompose/messengercompose.xul
* address book window > chrome://messenger/content/addressbook/addressbook.xul
* prompt window > chrome://global/content/commonDialog.xul
*
*/
if (location == "chrome://messenger/content/messenger.xul") {
setTimeout(function () {
try {
/* unbind Help F1 */
var keyset = document.getElementById("mailKeys");
var key = document.getElementById("key_openHelp");
keyset.removeChild(key);
/* bind Example F1 */
// window.key_example = function (event) {
// alert("Example 1");
};
var keyset = document.getElementById("mailKeys");
var key = document.createElement("key");
key.setAttribute("id", "key_TBcloseTab");
// key.setAttribute("key", "A"); // A
// key.setAttribute("modifiers", "control,shift"); // Ctrl+Shift
// key.setAttribute("modifiers", "alt"); // Alt
key.setAttribute("keycode", "VK_F1"); // F1
// key.setAttribute("command", "cmd_toggleQuickFilterBar");
key.setAttribute("oncommand", "document.getElementById('tabmail').closeTab(document.popupNode);");
// key.setAttribute("oncommand", "alert('Example 2');");
keyset.appendChild(key);
} catch (e) {
Components.utils.reportError(e);
};
}, 1000);
}
if (location == "chrome://messenger/content/messageWindow.xul") {}
if (location == "chrome://messenger/content/messengercompose/messengercompose.xul") {}
if (location == "chrome://messenger/content/addressbook/addressbook.xul") {}
if (location == "chrome://global/content/commonDialog.xul") {}
})();
Can someone help? Thank you very much.