TB78 moves addon buttons back to customize toolbar

User Help for Mozilla Thunderbird
hopalongrock
Posts: 53
Joined: October 7th, 2017, 11:19 am

TB78 moves addon buttons back to customize toolbar

Post by hopalongrock »

The drag is successful, I can drag to addon buttons to any toolbar.
However after restart they are back again in the customize toolbar, except for the buttons moved into mail toolbar (Get messages, ....)

For example:
uBlock0_1.28.5b9.thunderbird.xpi
preferences_button-1.0-tb.xpi
toggle_message_pane-1.0-tb.xpi
config_button-1.1-tb.xpi
restart_button-1.0-tb.xpi
taskviewlayout-55.3-tb.xpi

Can I do something to keep the buttons where I moved them?
User avatar
DanRaisch
Moderator
Posts: 127224
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Re: TB78 moves addon buttons back to customize toolbar

Post by DanRaisch »

Are you using any sort of cleanup utility, li CcLeaner?
Have you confirmed that all of those extensions are compatible with version 78?
morat
Posts: 6421
Joined: February 3rd, 2009, 6:29 pm

Re: TB78 moves addon buttons back to customize toolbar

Post by morat »

I tried the restart button on the menubar. It is in the customize toolbar window at startup.

Restart Button by Dillinger
http://addons.thunderbird.net/thunderbird/addon/987787

Config Button by Dillinger
http://addons.thunderbird.net/thunderbird/addon/987784

Preferences Button by Dillinger
http://addons.thunderbird.net/thunderbird/addon/987857

Toggle Message Pane by Dillinger
http://addons.thunderbird.net/thunderbird/addon/987785

P.S.

ThunderKdB (see "Thunderbird 78 Compatible" for extension list)
http://cleidigh.github.io/ThunderKdB/index.html
Last edited by morat on August 15th, 2020, 9:51 am, edited 1 time in total.
hopalongrock
Posts: 53
Joined: October 7th, 2017, 11:19 am

Re: TB78 moves addon buttons back to customize toolbar

Post by hopalongrock »

DanRaisch wrote:Are you using any sort of cleanup utility, li CcLeaner?
Have you confirmed that all of those extensions are compatible with version 78?
Yes, I'm using CcLeaner.
EDIT: Only "Compact databases" is set for Thunderbird

Preferences_button, toggle_message_pane, config_button, restart_button and taskviewlayout is from addons.thunderbird.net and marked as "Works with Thunderbird 68.0 - *",

I use regularly preferences_button, toggle_message_pane, config_button, restart_button, and they work fine, I'm just getting to know taskviewlayout.

uBlock0 is beta, and is from Gitgub, works fine.
Last edited by hopalongrock on July 31st, 2020, 9:28 am, edited 1 time in total.
hopalongrock
Posts: 53
Joined: October 7th, 2017, 11:19 am

Re: TB78 moves addon buttons back to customize toolbar

Post by hopalongrock »

morat wrote:ThunderKdB (see "Thunderbird 78 Compatible" for extension list)
http://cleidigh.github.io/ThunderKdB/index.html
Thanks for the list, Preferences_button, toggle_message_pane, config_button, restart_button and taskviewlayout is in "Thunderbird MailExtension or 78 Compatible (83)" list.
morat
Posts: 6421
Joined: February 3rd, 2009, 6:29 pm

Re: TB78 moves addon buttons back to customize toolbar

Post by morat »

The restart button is a browserAction button and the default toolbar is the "Mail Toolbar".

A browserAction button works correctly on the default toolbar. If I move a browserAction button to the "Menu Bar", then the button moves to the customize toolbar window at startup.

browserAction buttons don't persist outside the default toolbar
http://bugzilla.mozilla.org/show_bug.cgi?id=1598190
http://bugzilla.mozilla.org/show_bug.cgi?id=1584160#c14

I tried to set the "Menu Bar" currentset in the xulstore.json file using the error console, but the workaround fails.
hopalongrock
Posts: 53
Joined: October 7th, 2017, 11:19 am

Re: TB78 moves addon buttons back to customize toolbar

Post by hopalongrock »

morat wrote:The restart button is a browserAction button and the default toolbar is the "Mail Toolbar".

A browserAction button works correctly on the default toolbar. If I move a browserAction button to the "Menu Bar", then the button moves to the customize toolbar window at startup.

browserAction buttons don't persist outside the default toolbar
http://bugzilla.mozilla.org/show_bug.cgi?id=1598190
http://bugzilla.mozilla.org/show_bug.cgi?id=1584160#c14
So this is officially a bug, unfortunately for 9 months now.

The Mail Toolbar is unfortunate as default as I think, because in most cases the tabs hide it, so the buttons are not visible.

Is the default the developer's decision or a Mozilla default?
morat wrote:I tried to set the "Menu Bar" currentset in the xulstore.json file using the error console, but the workaround fails.
I don’t know about this, it is beyond my knowledge.
morat
Posts: 6421
Joined: February 3rd, 2009, 6:29 pm

Re: TB78 moves addon buttons back to customize toolbar

Post by morat »

The default toolbar is the decision of the app developers, not the addon developer.

Restart Button Source
http://github.com/cleidigh/ThunderKdB/t ... button/src
morat
Posts: 6421
Joined: February 3rd, 2009, 6:29 pm

Re: TB78 moves addon buttons back to customize toolbar

Post by morat »

You could use the userChromeJS extension to set the "Menu Bar" currentset at startup. (for advanced users only)

You need to add the id for each item on the "Menu Bar" to the userChrome.js file.

Code: Select all

/* Thunderbird userChrome.js */

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

(function () {
  if (location == "chrome://messenger/content/messenger.xul" ||
      location == "chrome://messenger/content/messenger.xhtml") {
    setTimeout(function () {
      try {
        var ids = [];
        ids.push("menubar-items"); // File Edit View Go Message Tools Help Wrapper

        ids.push("restartbutton_dillinger-browserAction-toolbarbutton");     // Restart Button
        ids.push("configbutton_dillinger-browserAction-toolbarbutton");      // Config Button
        ids.push("prefsbutton_dillinger-browserAction-toolbarbutton");       // Preferences Button
        ids.push("togglemessagepane_dillinger-browserAction-toolbarbutton"); // Preview Button

        ids.push("spring");              // Flexible Space
        ids.push("mailviews-container"); // Mail Views

        var toolbar = document.getElementById("mail-toolbar-menubar2"); // Menu Bar
        toolbar.currentSet = ids.join(",");
        toolbar.setAttribute("currentset", ids.join(","));
        Services.xulStore.persist(toolbar, "currentset");  // stores to xulstore.json file
      } catch (e) {
        Components.utils.reportError(e);
      }
    }, 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

You do not need to purge the caches with jikamens' version.

userChromeJS by alta88 (obsolete)
http://userchromejs.mozdev.org/
http://userchromejs.mozdev.org/faq.html

I tested the userChrome.js file in Thunderbird 78 with Dillinger's buttons. It works for me.

P.S.

Here is how to show the "Menu Bar" currentset using the error console. (useful for testing)

Code: Select all

(function () {
  var url = "chrome://messenger/content/messenger.xul";   // Thunderbird 68
  var url = "chrome://messenger/content/messenger.xhtml"; // Thunderbird 78
  var id = "mail-toolbar-menubar2";                       // Menu Bar
  var toolbar = document.getElementById(id);
  var arr = [];
  arr.push("1: " + Services.xulStore.getValue(url, id, "currentset"));
  arr.push("2: " + toolbar.getAttribute("currentset"));
  arr.push("3: " + toolbar.currentSet);
  console.log(arr.join("\n\n"));
})();
hopalongrock
Posts: 53
Joined: October 7th, 2017, 11:19 am

Re: TB78 moves addon buttons back to customize toolbar

Post by hopalongrock »

The addon and Your userChrome.js works fine, thank you!

I don't understand the meaning of this sentence:
"Here is how to show the "Menu Bar" currentset using the error console. (useful for testing)"

When I copied the code into the error console, I get the error:

Failed to analyze input string unterminated string literal js-property-provider.js:370:13

(function () {
var url = "chrome://messenger/content/messenger.xul"; // Thunderbird 68
var url = "chrome://messenger/content/messenger.xhtml"; // Thunderbird 78
var id = "mail-toolbar-menubar2"; // Menu Bar
var toolbar = document.getElementById(id);
var arr = [];
arr.push("1: " + Services.xulStore.getValue(url, id, "currentset"));
arr.push("2: " + toolbar.getAttribute("currentset"));
arr.push("3: " + toolbar.currentSet);
console.log(arr.join("\n\n"));
})();
morat
Posts: 6421
Joined: February 3rd, 2009, 6:29 pm

Re: TB78 moves addon buttons back to customize toolbar

Post by morat »

In Thunderbird, the browser console is called the error console.

Tools > Developer Tools > Error Console (Ctrl+Shift+J)

You need to enable the "Logs" button to show the output in the error console.

If you evaluate the follow expression with the "Logs" button disabled, then you won't see the output.

Code: Select all

console.log("test");
Error Console
http://developer.mozilla.org/docs/Tools/Browser_Console
Failed to analyze input string unterminated string literal js-property-provider.js:370:13
I get the js-property-provider.js error as well. Ignore it. The cause of the error isn't the code snippet.
hopalongrock
Posts: 53
Joined: October 7th, 2017, 11:19 am

Re: TB78 moves addon buttons back to customize toolbar

Post by hopalongrock »

Thanks.

How can I add the Add-ons button instead of Mail Views button.
I commented out ids.push("mailviews-container"); // Mail Views ,
but don't know the name or id for the Add-ons button.
Is somewhere a table ?
morat
Posts: 6421
Joined: February 3rd, 2009, 6:29 pm

Re: TB78 moves addon buttons back to customize toolbar

Post by morat »

You can customize the menubar using the customize toolbar window, then run the following code snippet in the error console to show the menubar currentset.

Code: Select all

document.getElementById("mail-toolbar-menubar2").currentSet;
If you move the "Reply" button to the menubar, then the "button-reply" id is added to the menubar currentset.

You can add the "button-reply" id to the userChrome.js file like so...

Code: Select all

ids.push("button-reply"); // Reply
hopalongrock
Posts: 53
Joined: October 7th, 2017, 11:19 am

Re: TB78 moves addon buttons back to customize toolbar

Post by hopalongrock »

Many thanks, Add-ons button is now fixed in menubar with ids.push("button-addons");
User avatar
pdrummond
Posts: 128
Joined: December 31st, 2004, 1:23 pm
Location: Ottawa Canada
Contact:

Re: TB78 moves addon buttons back to customize toolbar

Post by pdrummond »

morat wrote:...browserAction buttons don't persist outside the default toolbar
http://bugzilla.mozilla.org/show_bug.cgi?id=1598190
http://bugzilla.mozilla.org/show_bug.cgi?id=1584160#c14
I suggest everyone vote for these bugs so they get a higher priority. Nothing has happened in 10 months. It looks like it wouldn't take much time :wink:
Post Reply