Thunderbird/Add-ons Guide 57: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(added mozIntl.DateTimeFormat)
(Added examples)
Line 15: Line 15:
** nsILocaleService and friends
** nsILocaleService and friends
** nsIScriptableDateFormat -- replacement: Intl.DateTimeFormat and mozIntl.DateTimeFormat
** nsIScriptableDateFormat -- replacement: Intl.DateTimeFormat and mozIntl.DateTimeFormat
** nsIFilePicker.show() -- replacement: nsIFilePicker.open() (async)
** nsIFilePicker.show() -- replacement: nsIFilePicker.open() (async), example: [https://hg.mozilla.org/comm-central/rev/d960dcde18c4#l6.12 Changeset where Thunderbird implemented that change]
** nsIDownloadManager
** nsIDownloadManager
** Promise.jsm -- replacement: PromiseUtils.jsm
** Promise.jsm -- replacement: PromiseUtils.jsm
Line 37: Line 37:
* Removed in mozilla58
* Removed in mozilla58
** Date.prototype.toLocaleFormat
** Date.prototype.toLocaleFormat
** {get,set}ComplexValue use of nsISupportsString -- replacement: {get,set}StringPref()
** {get,set}ComplexValue use of nsISupportsString -- replacement: {get,set}StringPref(), example: [https://hg.mozilla.org/comm-central/rev/3a0c2f6597ef#l1.12 Changeset where Thunderbird implemented that change]
** Mechanism to store add-on preferences in defaults/preferences/xx.js. '''Thunderbird 58 Beta not affected due to backout of this core change.''' Work on the way to re-establish this feature, see {{bug|1414398}}.  
** Mechanism to store add-on preferences in defaults/preferences/xx.js. '''Thunderbird 58 Beta not affected due to backout of this core change.''' Work on the way to re-establish this feature, see {{bug|1414398}}.  



Revision as of 19:24, 28 November 2017

Add-ons Guide for Thunderbird 57 and beyond

FIRST DRAFT

Mozilla core have disabled "legacy" add-ons (not based purely on WebExtensions) in Firefox 57. Since this type of add-on is not supported from mozilla57 any more, a lot of interfaces have been removed from Mozilla core.

However, Thunderbird 57-59 and Seamonkey still support these add-ons if the appropriate modifications are done to adapt to the changed interfaces. In general, Thunderbird is adding WebExtension support (bug 1396172) while maintaining "legacy" add-ons and hybrid add-ons.

The removed interfaces are:

  • Removed in mozilla57:
    • nsILocalFile -- replacement: nsIFile
    • extIApplication, nsIEntityConverter
    • nsIProgrammingLanguage
    • nsILocaleService and friends
    • nsIScriptableDateFormat -- replacement: Intl.DateTimeFormat and mozIntl.DateTimeFormat
    • nsIFilePicker.show() -- replacement: nsIFilePicker.open() (async), example: Changeset where Thunderbird implemented that change
    • nsIDownloadManager
    • Promise.jsm -- replacement: PromiseUtils.jsm
    • nsIPrefBranch2 and nsIPrefBranchInternal -- replacement: nsIPrefBranch
    • nsIExternalProtocolService.loadUrl -- replacement: nsIExternalProtocolService.loadURI
    • nsIInputStreamPump.init: Change of arguments
  • JS and XUL changes in mozilla57 [1]
    • `for each ()` construct [2] -- replacement: 'for (x of object)' or 'for (x of Object.values())'
    • `with` construct [3]
    • catch (ex if ex instanceof ExceptionType) (removed in mozilla47 already)
    • versioned Javascript support -- replacement: In XUL files, links to JS files using <script type="application/x-javascript" ... > or <script type="application/x-javascript;version=1.7" ... >, change to <script type="application/javascript" ... >
    • __iterator__ and Iterator()
    • "legacy" generators, now need to use `function*` syntax (removed in mozilla? already)
  • Changes in thunderbird57
    • steelIApplication (removed due to removal of extIApplication) -- replacement: Services, AppConstants
    • for (x in fixIterator(obj)) (removed due to removal of __iterator__) -- replacement: for (x of fixIterator(obj))


  • Removed in mozilla58
    • Date.prototype.toLocaleFormat
    • {get,set}ComplexValue use of nsISupportsString -- replacement: {get,set}StringPref(), example: Changeset where Thunderbird implemented that change
    • Mechanism to store add-on preferences in defaults/preferences/xx.js. Thunderbird 58 Beta not affected due to backout of this core change. Work on the way to re-establish this feature, see bug 1414398.
  • JS changes in mozilla58 [4]
    • StopIteration [5]


  • Removed in mozilla59
    • Inline options. Analysis on the way of how this feature can be restored, see bug 1419145. Current solution: Add-ons need to embed a WebExtension to display an options dialog[6][7], not working due to bug 1418914.
  • JS changes in mozilla59 [8]
    • catch (ex if ...)