Closed Bug 308881 Opened 19 years ago Closed 19 years ago

Easier access to extension options

Categories

(Toolkit :: Add-ons Manager, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: toadking, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050908 Firefox/1.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050908 Firefox/1.4

There should be an easier way to access an extension's options other than the
ways the extension itself provides and the Extensions manager window

Reproducible: Always

Steps to Reproduce:




I've made a little script to run with the loaded browser window. I have yet to
test if it works or not, though:

var RDFService =
Components.classes['@mozilla.org/rdf/rdf-service;1'].getService(Components.interfaces.nsIRDFService);
var Container =
Components.classes['@mozilla.org/rdf/container;1'].getService(Components.interfaces.nsIRDFContainer);
var extensionDS=
Components.classes['@mozilla.org/extensions/manager;1'].getService(Components.interfaces.nsIExtensionManager).datasource;
var extList = new Array();
var root = RDFService.GetResource('urn:mozilla:extensions:root');
var nameArc = RDFService.GetResource('http://www.mozilla.org/2004/em-rdf#name');
var optionsURLArc =
RDFService.GetResource('http://www.mozilla.org/2004/em-rdf#optionsURL');
var disabledArc =
RDFService.GetResource('http://www.mozilla.org/2004/em-rdf#disabled');
Container.Init(extensionDS, root);
var elements = Container.GetElements();
while(elements.hasMoreElements())
{
  var element = elements.getNext();
  element.QueryInterface(Components.interfaces.nsIRDFResource);
  var target = extensionDS.GetTarget(element, nameArc, true);
  if (target) name =
target.QueryInterface(Components.interfaces.nsIRDFLiteral).Value;
  target = extensionDS.GetTarget(element, optionsURLArc, true);
  if (target) optionsURL =
target.QueryInterface(Components.interfaces.nsIRDFLiteral).Value;
  target = extensionDS.GetTarget(element, disabledArc, true);
  if (target) disabled =
target.QueryInterface(Components.interfaces.nsIRDFLiteral).Value;
  if (disabled && disabled == 'true' && optionsURL && optionsURL != '')
extList.push(name + "\n" + optionsURL).sort(); // Put in a string to easily
alphabetize
}
if (extList.length) {
  var optionsMenu = document.createElement('menu');
  optionsMenu.setAttribute('label', 'Extension Options'); // Of course, this
should be changed for localization
  optionsMenu.setAttribute('accesskey', 'O'); // completely optional, I'm not
sure if some other menu item uses this accesskey...
  var optionsPopup = document.createElement('menupopup');
  for (var i = 0; i < extList.length; i++) {
    var extension = extList[i].match(/(.+?)\n(.+?)/);
    var extItem = document.createElement('menuitem');
    extItem.setAttribute('label', extension[1] + ' Options...'); // Once again,
should be changed for localization
    extItem.setAttribute('oncommand', 'window.open(\'' + extension[2] + '\',
\'extensionOptions\', \'chrome, modal, dialog\');');
    optionsPopup.appendChild(extItem);
  }
  optionsMenu.appendChild(optionsPopup);
  var separator = window.getElementById('devToolsSeparator');
  separator.parentNode.insertBefore(optionsMenu, seperator);
}
I fail to see why it is so hard to select an extension in EM and press the
[Options] button
(In reply to comment #1)
> I fail to see why it is so hard to select an extension in EM and press the
> [Options] button

The world is full of lazy people, me being one of them. It's time for our
society to stop discrimination against the lazy.

But the true reason is a lot of extension developers (including myself) put menu
items to the options for their extensions under the Tools menu for users to find
easier (especially new Firefox users who don't know the Extensions Manager has
the extension options in it also), quickly making the menu a total mess. It
would also be easier to navigate without a mouse, which I know a very few people
don't have them and many people like using key shortcuts whenever possible.
Properly designed options are typically accessed / configured seldom by the
average user though some people do like to tweak a lot. For example, TBP's prefs
are in the app's pref panel - it replaces the Tabbed Browsing panel - and the
settings it provides also allow specifying alternative behavior by using meta keys.

In regards to making it more obvious to a user that an extension has options
http://wiki.mozilla.org/Firefox:Extension_Manager_UI

Personally, I don't think the answer is to add a new place where extension
options can be accessed separate from the EM ui since this would add more
inconsistency in the ui on how to do things though I do think that discovering
an extension has options needs to be clearer as the wiki link suggests. For
those that want a method that allows them to access extensions options in this
manner I think an extension that provides this would be a better answer.
For the reasons Rob mentions, I'm marking this WONTFIX, with the sidenote that
the design for extension options will be revisited when the design of the EM
itself is revisited.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → WONTFIX
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.