Changes

Jump to: navigation, search

Thunderbird/Add-ons Guide 63

2,157 bytes added, 00:37, 31 March 2019
document various things I ran into while upgrading my add-on for Thunderbird 68
<big>'''Add-ons Guide for Thunderbird 63 and beyond'''</big>
{{note|This page is now considered obsolete, see The documentation at https://thunderbird-webextensions.readthedocs.io/en/latest/how-to/extensions68.html instead!is a better place to start learning about converting add-ons to run on recent Thunderbird builds. However, this page contains details about specific issues you may encounter that aren't all documented there, so this may be a useful reference as well.|reminder}}
If you have programming questions or wish to discuss the future can be posted in the mozilla.dev.apps.thunderbird newsgroup, see [[Thunderbird/CommunicationChannels#If_you.27re_a_developer|Communication Channels]].
* XUL element method <tt>.removeItemAt()</tt>, replacement: <tt>.remove()</tt>, example: <tt>listElement.removeItemAt(i)</tt> -> <tt>listElement.getItemAtIndex(i).remove()</tt>
* You can also use <tt>.setUnsafeInnerHTML()</tt> or <tt>document.allowUnsafeHTML = true</tt>, as a workaround to the above, see [[Thunderbird/Add-ons_Guide_57#Removed_and_changed_in_mozilla60|here]].
* The interface of <tt>AddonManager.getAddonByID</tt> has changed. It now returns a promise, so instead of calling it as <tt>AddonManager.getAddonByID(''addon_id'', ''callback_function'')</tt>, you need to call it as <tt>AddonManager.getAddonByID(''addon_id'').then(''callback_function')</tt>.
== Removed in Thunderbird 63 ==
* XUL elements <tt>listbox</tt>, <tt>listboxitem</tt> and <tt>listcell</tt>. <br/>Replacement: <tt>richlistbox</tt> ([https://github.com/jobisoft/CategoryManager/commit/2267888be7de0d7ebe4f5b4626c48210c071b16f example migration])
* XUL <tt>stringbundleset</tt> / <tt>stringbundle</tt>. You will also be unable to use the `nsIStringBundleService` interface.<br/>Replacement: Use <tt>Services.strings.createBundle(...)</tt>.<br/>In order to use stringbundles, you need to load stringbundle.js in your XUL: <tt>&lt;script type="application/x-javascript" src="chrome://global/content/elements/stringbundle.js"/&gt;</tt>, but the XUL Overlay loader takes care of this. See also [https://bugzil.la/1459743 bug 1459743]. {{note|I am not sure the above information is correct with current Thunderbird trunk builds as of March 30, 2019. I got errors when attempting to embed <tt>stringbundle</tt> elements in XUL overlays. [[User:Jikamens|Jikamens]] ([[User talk:Jikamens|talk]]) 00:34, 31 March 2019 (UTC)}}
* <tt>mailServices.js</tt> has been renamed to <tt>MailServices.jsm</tt>. The old name keeps working for now, but you get a deprecation warning in the error console if you use the old name.
* Starting in Thunderbird 63, all XBL-bindings will be removed from Thunderbird. That means, that if you have a XBL=binding in your add-on that extends a binding that is removed, your binding will fail. With [https://bugzilla.mozilla.org/buglist.cgi?o1=equals&v1=1484976&f1=blocked this] query, you can see all the bugs related to de-xbl-ing Thunderbird, and see how the removal of each binding is handled.
* A bunch of globals in the message composition window were removed: <tt>nsIMsgCompDeliverMode</tt>, <tt>nsIMsgCompSendFormat</tt>, <tt>nsIMsgCompConvertible</tt>, <tt>nsIMsgCompType</tt>, <tt>nsIMsgCompFormat</tt>, <tt>nsIAbPreferMailFormat</tt>, <tt>nsIPlaintextEditorMail</tt>, <tt>nsISupportsString</tt>, and <tt>mozISpellCheckingEngine</tt>. If you use any of these, there are available as the same names underneath <tt>Ci.</tt> (a.k.a. <tt>Components.interfaces.</tt>).
== Removed in Thunderbird 64 ==
* XUL element <tt>colorpicker</tt>.<br/>Replacement: HTML <tt>input type=color</tt>
== Removed in Thunderbird 65 ==
* XUL element <tt>progressmeter</tt>.<br/>Replacement: HTML <tt>progress</tt> ([https://github.com/jobisoft/CategoryManager/commit/be23d9abfba29e5585d485348d84bd36c3c6bcaf example migration])
 
* There is no longer a <tt>statusbar</tt> element. Instead of putting <tt>statusbar</tt> elements inside a <tt>statusbarpanel</tt> in your XUL, they need to go inside an <tt>hbox</tt>. The <tt>hbox</tt> contains have the same names as the old <tt>statsusbar</tt> containers, so you just need to change the element type. Also, if your status bar items had popup menus attached to them, you will need to do that differently now as well. See [https://github.com/jikamens/send-later/blob/664468e4c29ba435edfeba8524d19a37a47dfda5/chrome/content/backgrounding.xul#L9 this example].
== Changes in Thunderbird 67 ==
* Thunderbird no longer passes in the <tt>aContext</tt> argument to the <tt>onDataAvailable</tt> methods of stream listeners, so stream listeners need to be updated so that they no longer expect this argument.
 
* <tt>MailUtils.getFolderForUri</tt> was renamed to <tt>MailUtils.getExistingFolder</tt>.
 
==== Importing javascript modules ====
A major backwards-incompatible change was made to importing javascript modules. Where once you used any of these:
7
edits

Navigation menu