Closed Bug 1471811 Opened 3 years ago Closed 3 years ago
Error: Services is not defined" in autocomplete .xml
47 bytes, text/x-phabricator-request
|Details | Review|
I tried to make the Quickerfiler addon work again. After fixing some easy issues, I got this message in the error console: ReferenceError: Services is not defined[Learn More] autocomplete.xml:1764:11 The file given is is chrome://global/content/bindings/autocomplete.xml . Line 1764 is in this part of the file: <method name="_unescapeUrl"> <parameter name="url"/> <body> <![CDATA[ return Services.textToSubURI.unEscapeURIForUI("UTF-8", url); ]]> </body> </method>
Does this happen without the add-on? autocomplete.xml is Mozilla core code used for Firefox. Does Firefox show a problem? Otherwise, it will be hard to convince the Mozilla core people that a fix is needed here.
As far as my tests go I have determined that this guide to make custom autocomplete search component does not work either for the same reason as mentioned above. So if someone could make the changes to this guide to make this work we're all good or perhaps it is in fact a bug. https://developer.mozilla.org/en-US/docs/Mozilla/How_to_implement_custom_autocomplete_search_component
Yes, ChromeUtils.import("resource://gre/modules/Services.jsm"); is missing in one/more of the <constructor>s in autocomplete.xml. That should be fixed, right, Marco?
Component: General → Autocomplete
Product: Thunderbird → Toolkit
Version: 60 → 60 Branch
This regressed in bug 1436559, autocomplete.xml may need to either import Services, or grow a this._services field. Gijs, what do you think?
Flags: needinfo?(mak77) → needinfo?(gijskruitbosch+bugs)
(In reply to Marco Bonardo [::mak] from comment #4) > This regressed in bug 1436559, autocomplete.xml may need to either import > Services, or grow a this._services field. > Gijs, what do you think? We should really just make Services/AppConstants/XPCOMUtils available on every privileged scope. Though the binding is likely to go away soon as well... Anyway, in the meantime, I guess we could take a patch that adds a field or adds an import or something.
This should do it. Services is used in two bindings, so I added it to the corresponding constructors. Please excuse the following comment (no offence intended): I've never understood why you leave fixing regressions to others, perhaps you can explain that.
Regarding your question, I think it's no surprise that the Firefox codebase is undergoing a large rewrite, that affects other products based on the same codebase, and that our resources are limited (barely sufficient for Firefox, in my opinion). From a Firefox point of view this is not a regression, we import Services pretty much everywhere. Having a fix in a week would be a P1, that this is not, so if you want a quick fix, I don't see alternatives to contributing a patch. As usual we try to assist as best as possible with available time. I'm looking at the patch, but I'm not convinced of the approach, so I'm asking for a second opinion around, stay tuned.
I'm sorry for late, picking this.
Assignee: nobody → mak77
Status: NEW → ASSIGNED
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/326ed3b7c894 "ReferenceError: Services is not defined" in autocomplete.xml. r=Gijs,jorgk
You need to log in before you can comment on or make changes to this bug.