Closed Bug 1449122 Opened 8 years ago Closed 8 years ago

XMLHttpRequest object is missing in TB60

Categories

(Thunderbird :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: john, Unassigned)

Details

User Agent: Mozilla/5.0 (iPad; CPU OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.0 Mobile/14G60 Safari/602.1 Steps to reproduce: In TB59 I get the xmlhttprequest like so: Let req = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Components.interfaces.nsIXMLHttpRequest); In TB61 it is simply: let req = new XMLHttpRequest(); None of these work in TB60. Could be related to bug 1164188? Actual results: Javascript error, either XMLHttpRequest is not defined, or Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"] is null Expected results: Get an XMLHttpRequest object
Component: Untriaged → General
Hmm, bug 1164188 hasn't landed, so it can't have any effect yet. I assume you're talking about a problem with an add-on, right? We use Components.utils.importGlobalProperties(["XMLHttpRequest"]); or Cu.importGlobalProperties(["XMLHttpRequest"]); See: https://dxr.mozilla.org/comm-central/search?q=XMLHttpRequest&redirect=false
I'll mark this invalid, since to my knowledge TB is working. Feel free to comment further and we'll try to help you with your add-on, time permitting.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
Thanks for pointing out the import issue. That did the trick. So this boils down to a documentation issue. For someone who used the "old" way: Let req = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Components.interfaces.nsIXMLHttpRequest); and who learned, that support for that was dropped in TB60 (because it no longer worked) and searched for an solution, for example here: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest and learned by trial-and-error, that this works in TB61 but not in TB60, it his very difficult to distinguish this from a bug. Apparently something did land in TB61, because there: let req = new XMLHttpRequest(); works without the import, or am I missing something here as well? Thanks for your time!
The TB team is also just trying to follow Mozilla core changes without much insight into the underlying issues. I'll add the Cu.importGlobalProperties(["XMLHttpRequest"]); to the documentation.
BTW, XMLHttpRequest was already mentioned here: https://wiki.mozilla.org/Thunderbird/Add-ons_Guide_57 I've now clarified this more. Even in TB 61 the Cu.importGlobalProperties(["XMLHttpRequest"]); still works, no? Someone had written into the Wiki that from TB 60 that call isn't necessary any more, but that should be TB 61, no?
Corr(In reply to Jorg K (GMT+1) from comment #5) > BTW, XMLHttpRequest was already mentioned here: > https://wiki.mozilla.org/Thunderbird/Add-ons_Guide_57 Oh, I knew that page, but did not see that. Sorry. > I've now clarified this more. Even in TB 61 the > Cu.importGlobalProperties(["XMLHttpRequest"]); still works, no? My AddOn is still working in TB61, after I added the import, if that was the question. The import is not doing any harm, even if it is not needed in TB61 > Someone had written into the Wiki that from TB 60 that call isn't necessary any more, > but that should be TB 61, no? From my findings: Yes. Needed in TB60, not needed in TB61. Thanks again for your work and your time.
You need to log in before you can comment on or make changes to this bug.