tbkeys
tbkeys copied to clipboard
Need a custom function that only close tab
I need a custom function that only close tab like https://addons.thunderbird.net/en-US/thunderbird/addon/close-on-escape-too/
I tried func:CloseTabOrWindow, but it terminates thunderbird itself too if there is no tab opening. I also tried tbkeys:closeMessageAndRefresh, although it does not terminate thunderbird, it has another side effect: expands all thread (which I don't want either).
What I need is tbkeys:closeMessageAndRefresh, but does not expand thread.
(Note: I am using tbkeys-lite therefore writing arbitrary function is not possible)
if (win.document.getElementById("tabmail").tabContainer.selectedIndex != 0) {
win.CloseTabOrWindow();
}
This piece of code works exactly what I want. I'd like to be included in tbkeys-lite. I have to use tbkeys at the moment and set key binding as the code above.
Hey man,
here is a quick fix in case you don't want to wait until it's implemented in the actual add on.
Just go to your addons folder for your thunderbird profile, something like:
.thunderbird/<RANDOM_CHARS>.default/extensions
In case you are comfortable with vim you can just edit the file in place with vi [email protected]
.
If not you need to unzip the .xpi file, modify the files, zip them again and then drag and drop into thunderbird add-ons window (which installs the addon). Make sure to remove the old one before you install the modified version. In a bash shell you can do the following:
-
unzip [email protected] -d code
-
cd code
and edit implementation.js as described below -
zip -r ../new_version.zip *
- Go to thunderbird add-on page, remove the old add-on and install the new one by dragging and dropping the
new_version.zip
.
What you need to modify
The code you posted is already part of the extension. You can find it in the implementation.js file. The problem is the line below that:
win.goDoCommand("cmd_getMsgsForAuthAccounts");
Just comment out that line - looks like this for me:
Then reinstall the add-on and you should be good to go :)
Hope that helped :)
I would close the current tab like so.
window.document.getElementById('tabmail').closeTab();
Reference...
http://searchfox.org/comm-esr78/search?q=closeTab.aOptional®exp=true
Hey man, here is a quick fix in case you don't want to wait until it's implemented in the actual add on. Just go to your addons folder for your thunderbird profile, something like:
.thunderbird/<RANDOM_CHARS>.default/extensions
In case you are comfortable with vim you can just edit the file in place with
vi [email protected]
.If not you need to unzip the .xpi file, modify the files, zip them again and then drag and drop into thunderbird add-ons window (which installs the addon). Make sure to remove the old one before you install the modified version. In a bash shell you can do the following:
1. `unzip [email protected] -d code` 2. `cd code` and edit implementation.js as described below 3. `zip -r ../new_version.zip *` 4. Go to thunderbird add-on page, remove the old add-on and install the new one by dragging and dropping the `new_version.zip`.
What you need to modify The code you posted is already part of the extension. You can find it in the implementation.js file. The problem is the line below that:
win.goDoCommand("cmd_getMsgsForAuthAccounts");
Just comment out that line - looks like this for me:Then reinstall the add-on and you should be good to go :)
Hope that helped :)
This should probably be on the README.md somewhere near "Common key bindings" as a way how to actually add custom bindings.
Thanks! It helped me to make several needed "Common key bindings" working =)