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

Formatting, sentence phrasing touch-up, paragraph break, question title pharsing
(Answering a question)
(Formatting, sentence phrasing touch-up, paragraph break, question title pharsing)
Line 3: Line 3:
==== Removing install.rdf? ====
==== Removing install.rdf? ====


'''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 <tt>install.rdf<tt> 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 <tt>install.rdf</tt> to prevent Thunderbird from mishandling my extension?
 
'''Answer''':


==== Name confusion ====
==== Name confusion ====
Line 10: Line 12:


'''Question''': <tt>AddonManager.getAddonByID(...)</tt> 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?
'''Answer''': It is returning a promise now.
'''Answer''': It is returning a promise now.


Line 22: Line 25:
'''Question''': Can I write an addon and use the API that are already there... or do I have to create everything?
'''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
'''Answer''': Unclear what you're asking.


==== stringbundle removal and nsIStringBundleService ====
==== stringbundle removal and nsIStringBundleService ====
Line 30: Line 33:
   let sb = Components.classes["@mozilla.org/intl/stringbundle;1"].getService(Components.interfaces.nsIStringBundleService);
   let sb = Components.classes["@mozilla.org/intl/stringbundle;1"].getService(Components.interfaces.nsIStringBundleService);


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


====windows API====
==== adding a listener via tabs vs via windows ====
I tried
'''Question:''' When I try
   browser.tabs.onCreated.addListener(newTab);
   browser.tabs.onCreated.addListener(newTab);
and it worked, it ran newTab
that  works, and runs newTab. but if I try
I tried
   browser.windows.onCreated.addListener(newWindow);
   browser.windows.onCreated.addListener(newWindow);
and it didn't work although these events look exactly the same. What is the difference?
this doesn't work, although these events look exactly the same. What is the difference?
Blessings G
 
'''Answer''':
20

edits