GNotifier icon indicating copy to clipboard operation
GNotifier copied to clipboard

Detect on install which os the addon gets installed to

Open tooomm opened this issue 8 years ago • 6 comments

Display/hide settings in options accordingly and don't mess around with the user too much. :D On Firefox (win+mac) for example 80% of settings are not relevant...

settings_limitations

tooomm avatar Sep 18 '16 16:09 tooomm

I agree. It is a mess. Unfortunately, there is no super easy way how to make it more clear. Let's keep it open and maybe I will figure something out in the near future...

mkiol avatar Sep 19 '16 19:09 mkiol

Detecting the needed information should be possible regarding this: https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/system

console.log(system.env.PATH);
// operating system

and

console.log("id = " + system.id);
// host application name

I'm not a developer or such... you need to double check and validate for sure. But it sounds reasonable, there are many more variables listed on that page which might be helpful in that case.

The addon then would need to display only options which are relevant to the app and os the addon is installed to (which equals to hiding others). That might be a different problem. I don't know.

What do you think?

Anyway, I appreciate that you are aware of this and that you keep it in mind.^^

tooomm avatar Sep 19 '16 20:09 tooomm

Thank you for the hints. The problem is that for the preferences I decided to use built-in FF mechanism. I just defined various options using package.json file and FF is responsible for the presentation. Unfortunately with this approach, there is no place where I can insert some code that will hide/show options etc. :-(

I see two potential solutions:

  • create my own preferences window where I can code whatever I want, or
  • create many XPIs with different package.json for: Linux, Window, Firefox, Thunderbird, Seamonkey

mkiol avatar Sep 20 '16 13:09 mkiol

Oh, ok. That makes sense...

The second options sounds like a mess though, and much work to maintain and supply properly. I can imagine that it wouldn't be too helpful for the project either. Splitting comments, ratings, user/download count and such.

I have several small addons that have their own settings dialog. It's pretty straight forward to use from a user point of view. You get the settings menu once you hit the Options button in the "Extensions" tab, and the details about the addon, infos about the version, screenshots etc. if you hit More. Otherwise both bring you to the same page... which has both contents somehow combined. But I guess you know how that works.^^ ;)


I found this on how to create such a options dialog window:

  • https://developer.mozilla.org/en-US/docs/Mozilla/Preferences/Preferences_system
  • https://developer.mozilla.org/en-US/docs/Mozilla/Tech/Preferences_API
  • be aware of the note on top when reading this:
    https://developer.mozilla.org/en-US/Add-ons/Overlay_Extensions/XUL_School/Handling_Preferences#Preference_windows

tooomm avatar Sep 23 '16 15:09 tooomm

About this issue, maybe you could ask for help from the developer of the Classic Toolbar Buttons extension? That extension also uses the built-in FF mechanism, and the options are diferent depending on whether the addon is installed on Firefox, Thunderbird or SeaMonkey.

rcmero avatar Dec 24 '16 11:12 rcmero

Now with this add-on beeing Thunderbird only (#162) you can remove a lot of the (Thunderbird only) hints for future versions!

tooomm avatar May 13 '17 13:05 tooomm