Enable ESLint rule mozilla/use-services for toolkit/

RESOLVED FIXED in Firefox 59

Status

()

enhancement
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: standard8, Assigned: standard8)

Tracking

Trunk
mozilla59
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox59 fixed)

Details

Attachments

(2 attachments)

As we've been doing elsewhere, we should turn on mozilla/use-services for toolkit and avoid the overhead of going via .getService.
Try is showing an issue with my xpinstallConfirm.js changes. I think I've got a fix for it, but I really can't work out how to get that dialog up. I've tried a few things, including finding old non-webextensions, and removing amo from the whitelist etc.

The code that I need to trigger is here:

https://searchfox.org/mozilla-central/rev/797c93d81fe446f78babf20894f0729f15f71ee6/toolkit/mozapps/extensions/AddonManager.jsm#2880

Anyone any ideas?
Flags: needinfo?(rhelmer)
Comment on attachment 8930886 [details]
Bug 1417944 - Enable ESLint rule mozilla/use-services for toolkit/.

https://reviewboard.mozilla.org/r/202002/#review207520
Attachment #8930886 - Flags: review?(dtownsend) → review+
(In reply to Mark Banner (:standard8) from comment #3)
> Try is showing an issue with my xpinstallConfirm.js changes. I think I've
> got a fix for it, but I really can't work out how to get that dialog up.
> I've tried a few things, including finding old non-webextensions, and
> removing amo from the whitelist etc.
> 
> The code that I need to trigger is here:
> 
> https://searchfox.org/mozilla-central/rev/
> 797c93d81fe446f78babf20894f0729f15f71ee6/toolkit/mozapps/extensions/
> AddonManager.jsm#2880
> 
> Anyone any ideas?

Have you tried setting xpinstall.customConfirmationUI to false? This should (assuming it still works!) trigger the old install UI.
I finally found a way to test the dialog - I manually invoked it via Services.ww.openWindow in the browser console. So I'm happy my fix works now, though it may be worth investigating if that UI is really still accessible somehow.
Flags: needinfo?(rhelmer)
Comment on attachment 8930885 [details]
Bug 1417944 - Enable ESLint rule mozilla/use-services for toolkit/mozapps/extensions.

https://reviewboard.mozilla.org/r/202000/#review208288

::: toolkit/mozapps/extensions/nsBlocklistService.js:83
(Diff revision 2)
> -XPCOMUtils.defineLazyGetter(this, "gPref", function() {
> -  return Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefService).
> -         QueryInterface(Ci.nsIPrefBranch);
> -});
> +// XPCOMUtils.defineLazyGetter(this, "Services.prefs", function() {
> +//   return Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefService).
> +//          QueryInterface(Ci.nsIPrefBranch);
> +// });

please just remove this
Attachment #8930885 - Flags: review?(aswan) → review+
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3f946c460cd1
Enable ESLint rule mozilla/use-services for toolkit/mozapps/extensions. r=aswan
https://hg.mozilla.org/integration/autoland/rev/f7e3a378ee3d
Enable ESLint rule mozilla/use-services for toolkit/. r=mossop
https://hg.mozilla.org/mozilla-central/rev/3f946c460cd1
https://hg.mozilla.org/mozilla-central/rev/f7e3a378ee3d
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in before you can comment on or make changes to this bug.