Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thunderbird 68 support #30

Open
tasn opened this issue Sep 11, 2019 · 38 comments
Open

Thunderbird 68 support #30

tasn opened this issue Sep 11, 2019 · 38 comments

Comments

@tasn
Copy link

tasn commented Sep 11, 2019

Please add support for Thunderbird 68. I can't use thunderbird without this extension!!! :)

Thanks!

@jikamens
Copy link
Collaborator

jikamens commented Sep 11, 2019

I tried and failed a few months ago. :-)

It's not impossible, it's just that I didn't have the knowledge and experience necessary to accomplish it at the time and didn't have time to learn it.

I'm hoping someone else will step up to help, but so far no one has.

In the meantime, you can use my userChromeJS add-on to run JavaScript which modifies key bindings, though that's obviously not as user-friendly as keyconfig.

Here's some sample code from my own userChrome.js file:

function userChromeUnbindKey(keyset_id, key_id) {
    var keyset = document.getElementById(keyset_id);
    if (! keyset) {
        console.log("Could not find keyset " + keyset_id);
        return;
    }
    var key = document.getElementById(key_id);
    if (! key) {
        console.log("Could not find key " + key_id);
        return;
    }
    keyset.removeChild(key);
}

function userChromeBindKey(keyset_id, key, key_id, modifiers, command, observes) {
    var keyset = document.getElementById(keyset_id);
    if (! keyset) {
        console.log("Could not find keyset " + keyset_id);
        return;
    }
    var elt = document.createXULElement("key");
    if (key)
        elt.setAttribute("key", key);
    if (key_id)
        elt.setAttribute("key_id", key);
    if (modifiers)
        elt.setAttribute("modifiers", modifiers);
    if (command)
        elt.setAttribute("oncommand", command);
    if (observes)
        elt.setAttribute("observes", observes);
    keyset.appendChild(elt);
}

I use this, e.g., to bind Alt-S in the main Thunderbird window to a custom function I wrote:

if (location == "chrome://messenger/content/messenger.xul")
    userChromeBindKey("mailKeys", "s", "key_to_spamcop", "alt",
                      "jikMoveSpam();");

@tasn
Copy link
Author

tasn commented Sep 11, 2019

Ah, thanks! I'll try to play with it and see if I can manage. :)

@wshanks
Copy link

wshanks commented Sep 11, 2019

I came here to ask if there were plans to port keyconfig to Thunderbird 68 as well. I tried a bit to get keyconfig working in Thunderbird 68 myself but got stuck trying to get keyconfig-service.js to load.

I decided it was quicker to start over from scratch and build back up, testing that each part worked rather than try to reverse engineer which parts of keyconfig no longer worked and what had to change to make them work again. The addon I ended up with is https://github.com/willsALMANJ/tbkeys. It has my preferred bindings hard-coded into it and does not provide for customization, but others could take it and edit in their own bindings.

If no one figures out how to port keyconfig to Thunderbird 68, I could add a UI like keyconfig's for assigning keys to javascript snippets to my extension, so it could be used more easily by others, but for now I will wait to see anyone is able to get keyconfig itself working.

@tasn
Copy link
Author

tasn commented Sep 11, 2019

@willsALMANJ, thanks a lot, I also want it for the same keybindings (vim-like).

How do I build the extension? I couldn't find any resources online. Thanks!

Edit: and I tried just zipping the add-on folder, but while it installed, it didn't work.

@wshanks
Copy link

wshanks commented Sep 12, 2019

@tasn Zip everything inside the addon folder (i.e. there should be no addon/ folder inside the zip archive; manifest.json, etc. should be the top level) and save it as a file ending in .xpi. Then use "Install Add-on from File.." in the Add-ons Manager.

@tasn
Copy link
Author

tasn commented Sep 12, 2019

That's exactly what I did, it doesn't work. It correctly installs the addon, but doesn't actually bind the keys.
However, if I go to "Debug addons -> temporary install" and install by choosing the manifest file, it works (though only until I restart thunderbird). Weird.

@tasn
Copy link
Author

tasn commented Sep 12, 2019

@willsALMANJ: your plugin has an issue: hitting "r" and etc in the search box also triggers the keybindings. Do you get that as well, or is something completely crazy here?

@wshanks
Copy link

wshanks commented Sep 12, 2019

@tasn We should move discussion of the plugin to an issue in its repo, so this issue can stay dedicated to Thunderbird 68 support for keyconfig. I created an issue for the behavior you described.

@morat523035
Copy link

Here is a Dorando keyconfig version that supposedly works with Firefox 68.

http://forums.mozillazine.org/viewtopic.php?p=14845317#p14845317

@wshanks
Copy link

wshanks commented Oct 12, 2019

Something to be aware of: Thunderbird is dropping support of traditional add-ons completely with the next release. So trying to get something working beyond the userChrome.js workaround or the little extension I made might not be worth the effort.

@tasn
Copy link
Author

tasn commented Oct 12, 2019

:(

Your little extension will continue working though?

@wshanks
Copy link

wshanks commented Oct 15, 2019

No, my extension is a legacy extension as well. We need to look into what the Thunderbird developers are willing to add to MailExtensions for a keyboard shortcut API.

@ftoledo
Copy link

ftoledo commented Oct 18, 2019

i really miss this addon on thunderbird =((

@tasn
Copy link
Author

tasn commented Oct 19, 2019

I tried not using it for a few days, and it was hell. @willsALMANJ saved the day, but apparently only temporarily. :(

I won't just miss it. I need it!

@ftoledo
Copy link

ftoledo commented Oct 21, 2019

yeah @tasn thw @willsALMANJ extension work for me.. I just need only three shorcuts that save my life ([R]reply [A] Reply to all and [F]forward

=)
i hope that dorando-keyconfig can be ported to TB 68+

Saludos!

@rubo77
Copy link
Contributor

rubo77 commented Nov 11, 2019

Could you please explain again for a n00b, how to make the addon work in Thunderbird 68?

@ftoledo
Copy link

ftoledo commented Nov 11, 2019

Could you please explain again for a n00b, how to make the addon work in Thunderbird 68?

You must download or clone the source code , the put in into the extension directory at you profile

@rubo77
Copy link
Contributor

rubo77 commented Nov 11, 2019

I tried cloning this repo, and used tar:

git clone https://github.com/trlkly/dorando-keyconfig
cd dorando-keyconfig/
tar cvzf ../dorando-keyconfig.xpi *

then install this addon as file in thunderbird 68.1.2

but still blocked there: "... not compatible"

@ftoledo
Copy link

ftoledo commented Nov 11, 2019

hi @rubo77
You must zip the "addon" directory, not from the root directory of your clone
Saludos!

@rubo77
Copy link
Contributor

rubo77 commented Nov 11, 2019

@tasn Zip everything inside the addon folder (i.e. there should be no addon/ folder inside the zip archive; manifest.json, etc. should be the top level) and save it as a file ending in .xpi. Then use "Install Add-on from File.." in the Add-ons Manager.

thats what I did

@rubo77
Copy link
Contributor

rubo77 commented Nov 11, 2019

can someone please create such a working xpi archive and link it here?

@wshanks
Copy link

wshanks commented Nov 13, 2019

@rubo77 As far as I know, no one has gotten this add-on to work in Thunderbird 68. There was a link above about a version that worked in Firefox 68, but it wasn't clear that that really worked. There are workarounds like the userchromJS and tbkeys options linked to above. To get keyconfig to work in Thunderbird 68 would take more development time to debug which parts of the XUL API had been broken and find workarounds (without much documentation since XUL has been deprecated by Mozilla). Also, there is not much payoff to putting time into that debugging -- Thunderbird has announced that support for XUL addons like keyconfig will not be supported in the next release.

@rossmeissl
Copy link

For folks trying to use @jikamens userChromeJS stopgap to unbind default shortcuts (say, to free them up for the venerable Archive This), you may be wondering where to find key_id.

  • Find the name of the command here. You may find it easiest to search for "p", for example, to find what's currently assigned to the p key on your keyboard. In this example, you'll find:

    <!ENTITY prevUnreadMsgCmd.key "p">

    In this case, the name of the command is prevUnreadMsgCmd.

  • Now find that command here and take note of its id. For example:

    <key id="key_previousUnreadMsg" key="&prevUnreadMsgCmd.key;"       oncommand="goDoCommand('cmd_previousUnreadMsg')"/>

    This yields key_previousUnreadMsg which is the key_id we need for the userChromeUnbindKey function.

@ftoledo
Copy link

ftoledo commented Jan 24, 2020

any update for the 68+ support?
i really miss this extension =( using ctrl+L to forward emails sucks! jjaja!

@romanho
Copy link

romanho commented Jan 24, 2020

For the unbinding issue @rossmeissl mentioned above: I had the same issue for the 'r' key which I wanted to rebind. I did it by:

function RemoveBindings(kset, key) {
	var keyset = document.getElementById(kset);
	if (!keyset) {
		console.log("Could not find keyset " + keyset_id);
		return;
	}
	for (var e of keyset.children) {
		var k = e.getAttribute("key");
		if (k == key) {
			console.log("Remove binding "+e.id+" for key "+k);
			keyset.removeChild(e);
		}
	}
}

in my userChrome.js, and then RemoveBindings("mailKeys", "r") before binding 'r' with various modifiers. This simply removes all existing bindings.

@fefabfee
Copy link

I'm just an ordinary user, so my apologies if my comments on this forum are out of line. I have a simple observation. The growing pains Thunderbird is going through right now seem to be similar to what Firefox went through not long ago. I'm guessing the code might be similar. There is a developer on the Firefox side that has a shortcut add-on (https://github.com/mikecrittenden/shortkeys) that works in current version of Firefox. If the code was indeed similar, I was wondering if he could be of some help.

@koolx
Copy link

koolx commented Mar 8, 2020

I'm thinking about updating TB to the latest version. I just want to change 2 keys: R for reply and N for new mail compose. How do I make that happen in the userChromeJS add-on?

@wshanks
Copy link

wshanks commented Mar 9, 2020

@fefabfee Unfortunately, Firefox add-ons do not translate to Thunderbird very well right now. One problem is that Firefox add-ons add a lot their user facing components (like key event listeners) through content scripts that get loaded into the current web page. This works well because in Firefox the web page is almost the entire UI. In Thunderbird, most of the UI is various elements controlled by Thunderbird. I see on Thunderbird's roadmap one item is to replace current UI with a web-based UI. Perhaps when that is done add-ons will be able to inject content scripts into the main UI that can interact with the whole UI.

@sespadam
Copy link

sespadam commented May 4, 2020

For the unbinding issue @rossmeissl mentioned above: I had the same issue for the 'r' key which I wanted to rebind. I did it by:

function RemoveBindings(kset, key) {
	var keyset = document.getElementById(kset);
	if (!keyset) {
		console.log("Could not find keyset " + keyset_id);
		return;
	}
	for (var e of keyset.children) {
		var k = e.getAttribute("key");
		if (k == key) {
			console.log("Remove binding "+e.id+" for key "+k);
			keyset.removeChild(e);
		}
	}
}

in my userChrome.js, and then RemoveBindings("mailKeys", "r") before binding 'r' with various modifiers. This simply removes all existing bindings.

Just so great! Been finally able to disable some key bidings which are quite bothering for me; at least till version 78.

@michele-bs
Copy link

Plaease bring keyconfig back to life!
Thunderbird 68 users are awaiting with confidence.

10,000$ for brave programmers.

@ftoledo
Copy link

ftoledo commented Jul 16, 2020

tbkeys works, do you tried ? https://github.com/willsALMANJ/tbkeys

@rubo77
Copy link
Contributor

rubo77 commented Jul 19, 2020

@ftoledo Thousand thanks!!! 🥇

tbkeys works!!!!

👍 👍 👍 👍 👍 👍 👍 👍 👍

I added instructions how do remap the dangerous shortcuts here:

wshanks/tbkeys#15

@navennn
Copy link

navennn commented Jul 19, 2020

Thats great!
btw.
disable all shortcuts

{
    "0": "window.goDoCommand('')",
    "1": "window.goDoCommand('')",
    "2": "window.goDoCommand('')",
    "3": "window.goDoCommand('')",
    "4": "window.goDoCommand('')",
    "5": "window.goDoCommand('')",
    "6": "window.goDoCommand('')",
    "7": "window.goDoCommand('')",
    "8": "window.goDoCommand('')",
    "9": "window.goDoCommand('')",
    "a": "window.goDoCommand('')",
    "b": "window.goDoCommand('')",
    "c": "window.goDoCommand('')",
    "f": "window.goDoCommand('')",
    "j": "window.goDoCommand('')",
    "k": "window.goDoCommand('')",
    "m": "window.goDoCommand('')",
    "o": "window.goDoCommand('')",
    "p": "window.goDoCommand('')",
    "r": "window.goDoCommand('')",
    "s": "window.goDoCommand('')",
    "t": "window.goDoCommand('')",
    "u": "window.goDoCommand('')",
    "w": "window.goDoCommand('')",
    "x": "window.goDoCommand('')",
    "#": "window.goDoCommand('')",
    "]": "window.goDoCommand('')",
    "[": "window.goDoCommand('')"


}

@michele-bs
Copy link

Thank you all guys.

You can also refer to my related thread on Mozillazine.

@koolx
Copy link

koolx commented Jul 20, 2020

hey appreicate the link.. looking into it

@karmaking
Copy link

FWIW:
My keyconfig killerfeature is/was pressing a single key to move a message into a specific folder, and I was able to substitute this feature with the extension "Archive this" which offers this functionality (with presets and assignable hotkeys) quite well.

Would love to switch back to dorando-keyconfig nevertheless, though! :)

@eengstrom
Copy link

@karmaking - you might like Nostalgy++. There was a previous version of "Nostalgy" that stopped working well prior to TB 68, but the "++" version is updated for TB 78.

@karmaking
Copy link

Hi @eengstrom - thanks a lot! I'm giving this a try, as "Archive this" also stopped working since TB 78...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests