MozillaZine


Thunderbird 60 / Addon Compatibility

User Help for Mozilla Thunderbird
fibrolan
 
Posts: 80
Joined: January 29th, 2018, 8:10 pm

Post Posted February 14th, 2021, 12:59 pm

Can someone send me the installation version as I do not know how to edit the file to make it work by adding code.
my Thunderbird version is 78.7.1

Thanks
Robert

morat
 
Posts: 4264
Joined: February 3rd, 2009, 6:29 pm

Post Posted February 14th, 2021, 2:32 pm

@fibrolan

Do you know how to create the <profile_directory>\chrome\userChrome.css file?

You don't need to install the AutoUp addon or edit the autoup-1.03-tb.xpi file.

The userChromeJS addon uses the <profile_directory>\chrome\userChrome.js file.

Instructions: viewtopic.php?p=14879124#p14879124

fibrolan
 
Posts: 80
Joined: January 29th, 2018, 8:10 pm

Post Posted February 17th, 2021, 6:33 am

Good Morning!

I am trying to follow the instruction on the AutoUP Listener using userchromeJS. I am having a bit of an issue.
Instructions:

1. install userChromeJS extension
2. close email client
3. create or edit the userChrome.js file in the chrome folder
4. open email client

in point #3 create the file in chrome folder. I will assume it goes here C:\Program Files (x86)\Mozilla Thunderbird\chrome
my issue is in this folder, it only allows me to create a folder and not a file name. How do I create the Userchrome.js file ?

I know the question sounds stupid but I appreciate the help.

Robert

morat
 
Posts: 4264
Joined: February 3rd, 2009, 6:29 pm

Post Posted February 17th, 2021, 7:25 am

fibrolan wrote:assume it goes here C:\Program Files (x86)\Mozilla Thunderbird\chrome

The "Mozilla Thunderbird" folder is the installation folder, not the profile folder.

Installation folder
http://kb.mozillazine.org/Installation_directory

Profile folder
http://kb.mozillazine.org/Profile_folder

Check if the userChrome.js file is really in the chrome folder in the correct profile folder.

Thunderbird > Menu Bar > Help > Troubleshooting Information > Profile Folder > Open Folder

The userChrome.js file name is case sensitive. Windows hides file extensions by default. Novice users may end up mistakingly naming the file userChrome.js.txt without realizing it.

Also make sure that file is a plain text file without formatting or a BOM (byte order mark). You can open the file in a Firefox tab as a test.

You can create the plain text file with Microsoft Notepad using ANSI encoding.

Remember you must restart the application for the changes to take effect.

fibrolan
 
Posts: 80
Joined: January 29th, 2018, 8:10 pm

Post Posted February 17th, 2021, 8:06 am

OK, I followed the Instructions.

here is where I put the JS file
C:\ProgramData\Mozilla\updates\8216C80C92C4E828

Here are the file in the directory

userChrome.js I save it as ansi and copied the coding from post 4249 into this file.

morat

Posts: 4249
Joined: February 3rd, 2009, 9:29 pm
Post Posted November 26th, 2020, 9:59 pm

@fibrolan

You could use the userChromeJS extension to add the AutoUp listener. (for advanced users only)

CODE: SELECT ALL
/* Thunderbird userChrome.js */

// Thunderbird 68 uses the messengercompose.xul page.
// Thunderbird 78 uses the messengercompose.xhtml page.

(function () {
if (location == "chrome://messenger/content/messengercompose/messengercompose.xul" ||
location == "chrome://messenger/content/messengercompose/messengercompose.xhtml") {
setTimeout(function () {
try {
var AutoUp = {
ModifyKey: function(event) {
var doc = document.getElementById("content-frame").contentDocument;
var LeNoeu = doc.getSelection().anchorNode;
if ((event.charCode == 46) || (event.keyCode == 8) || event.altKey || event.ctrlKey || event.metaKey) return;
if ( true /* extensions.autoup.poincr */ && (event.keyCode == 13) && (LeNoeu.nodeName == "#text")) {
var jnc = doc.getSelection().anchorOffset - 1;
var LeText = LeNoeu.textContent;
while ((jnc > 0) && ((LeText.charCodeAt(jnc) == 32) || (LeText.charCodeAt(jnc) == 160))) {
jnc = jnc - 1;
var keyEvt = document.createEvent("KeyboardEvent");
if (keyEvt.initKeyEvent) {
var tgt = event.target;
keyEvt.initKeyEvent("keypress", true, true, null, false, false, false, false, 8, 0);
tgt.dispatchEvent(keyEvt);
keyEvt.stopPropagation;
}
}
if (((LeText.charCodeAt(jnc) >= 48) && (LeText.charCodeAt(jnc) <= 57)) ||
((LeText.charCodeAt(jnc) >= 65) && (LeText.charCodeAt(jnc) <= 90)) ||
((LeText.charCodeAt(jnc) >= 97) && (LeText.charCodeAt(jnc) <= 122)) ||
((LeText.charCodeAt(jnc) >= 224) && (LeText.charCodeAt(jnc) <= 255))) {
var keyEvt = document.createEvent("KeyboardEvent");
if (keyEvt.initKeyEvent) {
var tgt = event.target;
keyEvt.initKeyEvent("keypress", true, true, null, false, false, false, false, 0, 46);
tgt.dispatchEvent(keyEvt);
keyEvt.stopPropagation;
}
}
}
if ((event.charCode >= 65) && (event.charCode <= 90)) return;
if ((event.altKey) || (event.metaKey)) return;
if (((event.charCode >= 97) && (event.charCode <= 122)) ||
((event.charCode >= 224) && (event.charCode <= 255))) {
if (((LeNoeu.nodeName != "#text") && ( true /* extensions.autoup.majcr */ )) ||
(doc.getSelection().anchorOffset == 0)) {
var tgt = event.target;
event.preventDefault(true);
event.stopPropagation(true);
AutoUp.substituteChar(String.fromCharCode(event.charCode).toUpperCase().charCodeAt(0), tgt);
} else if (LeNoeu.nodeName == "#text") {
var inc = doc.getSelection().anchorOffset - 1;
var LeText = LeNoeu.textContent;
while ((inc > 0) && ((LeText.charCodeAt(inc) == 32) || (LeText.charCodeAt(inc) == 160))) inc--;
if ((LeText.charAt(inc) == '.') || (LeText.charAt(inc) == '?') || (LeText.charAt(inc) == '!')) {
var tgt = event.target;
event.preventDefault(true);
event.stopPropagation(true);
AutoUp.substituteChar(String.fromCharCode(event.charCode).toUpperCase().charCodeAt(0), tgt);
}
}
}
},
substituteChar: function(charCode, tgt) {
var keyEvt = document.createEvent("KeyboardEvent");
if (keyEvt.initKeyEvent) {
keyEvt.initKeyEvent("keypress", true, true, null, false, false, false, false, 0, charCode);
tgt.dispatchEvent(keyEvt);
keyEvt.stopPropagation;
}
},
};
document.getElementById("content-frame").contentDocument.addEventListener("keypress", AutoUp.ModifyKey, false);
} catch (e) {
Components.utils.reportError(e); // [check] Show Content Messages
}
}, 1000);
}
})();

userChromeJS by jikamens (compatible with TB 68 and TB 78)
http://addons.thunderbird.net/thunderbird/addon/986610

Instructions:

1. install userChromeJS extension
2. close email client
3. create or edit the userChrome.js file in the chrome folder
4. open email client

Something is still wrong as I cannot get capitals to work. Am I using the code for the file ?

thanks
Robert

morat
 
Posts: 4264
Joined: February 3rd, 2009, 6:29 pm

Post Posted February 17th, 2021, 8:45 am

fibrolan wrote:here is where I put the JS file C:\ProgramData\Mozilla\updates\8216C80C92C4E828

That alphanumeric folder is the update folder, not the profile folder.

Thunderbird > Menu Bar > Help > Troubleshooting Information > Update Folder > Open Folder
Thunderbird > Menu Bar > Help > Troubleshooting Information > Profile Folder > Open Folder (click here)

Remember to create the chrome folder in the profile folder.

i.e. <profile_folder>\chrome\userChrome.js

fibrolan
 
Posts: 80
Joined: January 29th, 2018, 8:10 pm

Post Posted February 17th, 2021, 8:57 am

I figured it out. I put the file in the updated folder and not in the profile folder. All seems to work now.

Thanks

Beside the code above, is there any other code I need to put into this file ??

morat
 
Posts: 4264
Joined: February 3rd, 2009, 6:29 pm

Post Posted February 17th, 2021, 9:36 am

So the AutoUp features work now in the compose window?

There is no other code. The hack doesn't use the AutoUp preferences.

Image

* Insert a dot before a carriage return (extensions.autoup.poincr preference)
* Uppercase after a carriage return (extensions.autoup.majcr preference)

The AutoUp options are set to enabled in the code.

fibrolan
 
Posts: 80
Joined: January 29th, 2018, 8:10 pm

Post Posted February 17th, 2021, 9:56 am

It works like a charm. Thanks for all the help. Can i uninstall the Autoup addon in Thunderbird ?

Thanks again

morat
 
Posts: 4264
Joined: February 3rd, 2009, 6:29 pm

Post Posted February 17th, 2021, 12:09 pm

@fibrolan

You can remove the AutoUp addon in the Addons Manager.

You're welcome.

fibrolan
 
Posts: 80
Joined: January 29th, 2018, 8:10 pm

Post Posted February 17th, 2021, 12:42 pm

Thanks for the help.

Is there a way to have the code capitalize the word "I" when typing ?

morat
 
Posts: 4264
Joined: February 3rd, 2009, 6:29 pm

Post Posted February 17th, 2021, 2:26 pm

@fibrolan

There is no simple solution for the feature.

mms Auto Correct (obsolete)
http://addons.thunderbird.net/thunderbird/addon/430090

Return to Thunderbird Support


Who is online

Users browsing this forum: alansecker and 3 guests