JohnEye
JohnEye

Reputation: 6895

Should I specify the application when using the same XUL overlay?

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?

Upvotes: 2

Views: 67

Answers (1)

nmaier
nmaier

Reputation: 33162

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.

Upvotes: 4

Related Questions