Well, before posting here I tried "AddonManager.getAddonByID" with the ID in install.rdf.It would work with an extension having the "uBlock0@raymondhill.net" ID type but not with an extension having the "{e4a8a97b-f2ed-450b-b12d-ee082ba24781}" ID type.I then tried "AddonManager.getAddonBySyncGUID" (with and without the braces) which as you've explained shouldn't work with the ID in install.rdf.

I suppose I only tried "AddonManager.getAddonByID" *without* the braces.Using it now *with* the braces, it works perfectly.