Talk:Thunderbird/Add-ons Guide 63: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(More formatting.)
(More formatting, some rephrasing for clarity)
Line 3: Line 3:
==== Removing install.rdf? ====
==== Removing install.rdf? ====


'''Question''': "To use this overlay loader... extensions must replace install.rdf file with a ... manifest.json" <- isn't it enough to just ''add' a manifest.json file? Or do I actually need to remove the `install.rdf` to prevent Thunderbird from mishandling my extension?
'''Question''': "To use this overlay loader... extensions must replace <tt>install.rdf</tt> file with a ... <tt>manifest.json</tt>". <- isn't it enough to just ''add'' a <tt>manifest.json</tt> file? Or do I actually need to remove the `install.rdf` to prevent Thunderbird from mishandling my extension?


==== Name confusion ====
==== Name confusion ====
Line 9: Line 9:
'''Suggestion''': It seems to me that it would be good to make clear somehow that bootstrapped and restartless are the same things - especially as we talk about overlay legacy addons and bootstrapped legacy addons.
'''Suggestion''': It seems to me that it would be good to make clear somehow that bootstrapped and restartless are the same things - especially as we talk about overlay legacy addons and bootstrapped legacy addons.


'''Question''': AddonManager.getAddonByID(..) used to be called asynchronously, it seems to not be called anymore?
'''Question''': <tt>AddonManager.getAddonByID(...)</tt> used to be called asynchronously, it seems to not be called anymore?


==== A sample extension? ====
==== A sample extension? ====


This sounds good. I'd like to create a WebExtensions addon... but I looked at https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json and it said that a manifest.json file is all that's required. I tried that, did a VERY basic manifest.json and zipped it and tried loading it in TB and was told it looked corrupted!
This sounds good. I'd like to create a WebExtensions addon... but I read [https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json this page]  and it said that a <tt>manifest.json</tt> file is all that's required. I tried that, did a VERY basic manifest.json and zipped it and tried loading it in TB and was told it looked corrupted!


'''Suggestion''': Could someone create a sample web extension, something like https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension ? That would be SO helpful. But I'm sure you're all too busy...
'''Suggestion''': Could someone create a sample web extension, something like <tt>https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension</tt> ? That would be SO helpful. But I'm sure you're all too busy...


==== Need to "create" APIs ====
==== Need to "create" APIs ====
Line 25: Line 25:
==== stringbundle removal and nsIStringBundleService ====
==== stringbundle removal and nsIStringBundleService ====


'''Question''': Thunderbird 63 - does removing XUL stringbundleset/stringbundle, also effect nsIStringBundleService?<br />
'''Question''': Thunderbird 63 - does removing XUL <tt>stringbundleset</tt>/<tt>stringbundle</tt>, also effect <tt>nsIStringBundleService?</tt><br />
Or can this still be used - e.g.:<br />
Or can this still be used - e.g.:<br />
let sb = Components.classes["@mozilla.org/intl/stringbundle;1"].getService(Components.interfaces.nsIStringBundleService); <br />   
<tt>let sb = Components.classes["@mozilla.org/intl/stringbundle;1"].getService(Components.interfaces.nsIStringBundleService);</tt> <br />   


'''Answer''':  'dies' means it will go away ;) so you need to change to as said:<br /> Replacement: Services.strings.createBundle(..).
'''Answer''':  <tt>nsIStringBundleService</tt> goes away as well. You need to use <tt>Services.strings.createBundle(..)</tt> as suggested on the page.

Revision as of 10:43, 8 December 2018

(Please place your question in a separate section, with a relevant heading.)

Removing install.rdf?

Question: "To use this overlay loader... extensions must replace install.rdf file with a ... manifest.json". <- isn't it enough to just add a manifest.json file? Or do I actually need to remove the `install.rdf` to prevent Thunderbird from mishandling my extension?

Name confusion

Suggestion: It seems to me that it would be good to make clear somehow that bootstrapped and restartless are the same things - especially as we talk about overlay legacy addons and bootstrapped legacy addons.

Question: AddonManager.getAddonByID(...) used to be called asynchronously, it seems to not be called anymore?

A sample extension?

This sounds good. I'd like to create a WebExtensions addon... but I read this page and it said that a manifest.json file is all that's required. I tried that, did a VERY basic manifest.json and zipped it and tried loading it in TB and was told it looked corrupted!

Suggestion: Could someone create a sample web extension, something like https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension ? That would be SO helpful. But I'm sure you're all too busy...

Need to "create" APIs

Question: Can I write an addon and use the API that are already there... or do I have to create everything?

Answer: Unclear what you're asking

stringbundle removal and nsIStringBundleService

Question: Thunderbird 63 - does removing XUL stringbundleset/stringbundle, also effect nsIStringBundleService?
Or can this still be used - e.g.:
let sb = Components.classes["@mozilla.org/intl/stringbundle;1"].getService(Components.interfaces.nsIStringBundleService);

Answer: nsIStringBundleService goes away as well. You need to use Services.strings.createBundle(..) as suggested on the page.