2

Let's say I want to use a single overlay in three applications at the same time. Should I specify which line in the manifest file applies to which application? Here's an example of what I currently have:

overlay chrome://browser/content/browser.xul chrome://myaddon/content/commonOverlay.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
overlay chrome://messenger/content/mailWindowOverlay.xul chrome://myaddon/content/commonOverlay.xul application={3550f703-e582-4d05-9a08-453d09bdfdc6}
overlay chrome://navigator/content/navigator.xul chrome://myaddon/content/commonOverlay.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}

Is it safe to omit the application flags, or is the best practice to be as explicit as in my example?

Mistalis
  • 17,793
  • 13
  • 73
  • 97
JohnEye
  • 6,436
  • 4
  • 41
  • 67
  • I recommend the firefox-addon tag, thats the one people usually use. – Noitidart Feb 12 '15 at 01:38
  • If you don't specify application flags it won't work. What do you mean by application flags though? This is what my install.rdf looks like: https://github.com/Noitidart/MouseControl/blob/master/chrome.manifest – Noitidart Feb 12 '15 at 01:39
  • @Noitidart: Thanks for the suggestion! The application flags are strings such as this: `application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}`. You can see them when you scroll to the right in my example. It works without them though, probably because my overlay is the same for all browsers and I'm applying it to `browser.xul` and `navigator.xul`, each of which is only present in one browser. I'm not sure whether it works because it's designed that way or whether it throws an error internally. – JohnEye Feb 12 '15 at 20:28

1 Answers1

4

This depends on what your add-on is actually supporting via em:targetApplication.

Usually having an application= is not required, because there simply is no ambiguity.

The only case I can imagine where it actually would make sense, would be if your add-on supported two different applications, which both have e.g. a chrome://browser/content/browser.xul but you only want to overlay Firefox but not the other application. There you'd need to be explicit.

nmaier
  • 32,336
  • 5
  • 63
  • 78
  • 1
    I'm still not sure whether omitting the application flag is a clean solution, do you think you could clarify that? Sure, it works, but since I'm going to contribute my changes to someone's GitHub repository, quality is a must. – JohnEye Feb 14 '15 at 23:45
  • 1
    It's a matter of taste and explicitness. So ultimately it's a matter of opinion. And in my opinion, having developed quite a bunch of add-ons and having reviewed thousands of submissions for AMO, there is absolutely no need to be explicit here, and explicitness also makes the manifest less readable. I'm on KISS for this one. – nmaier Feb 15 '15 at 00:21
  • @Noitidart: It means "Keep It Simple, Stupid" :-) – JohnEye Feb 15 '15 at 11:10