1

The "Options" in Firefox opens:

  • No icon on the taskbar
  • Are blocking the ability to restore to the main window.

How to do the extension to other windows, type:

chrome://browser/content/search/engineManager.xul
karthikr
  • 97,368
  • 26
  • 197
  • 188

1 Answers1

1

Without an icon and not in taskbar? You must mean a dialog window.

var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"].getService(Components.interfaces.nsIWindowWatcher);

ww.openWindow(window, "chrome://browser/content/search/engineManager.xul", "_blank", "chrome,dialog,modal,centerscreen,resizable", null);

If you want the no icon and nothing showing in taskbar, you MUST pass a first argument window, the dialog will be tied to this window, AND you MUST pass dialog and modal as a feature

https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIWindowWatcher#openWindow%28%29

can also use Services.ww.openWindow instead of var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"].getService(Components.interfaces.nsIWindowWatcher); IF you have imported Services.jsm.

That guy @nmaier is asleep right now :haha: but when you wake up nmaier man, is there anywhere that lists all the options we can use in the features argument?


Edit: Update:

Reason it's not working is because from your scope window is not defined. So set window to the most recent window like by going: Services.wm.getMostRecentWindow('navigator:browser'). Or you can use null in place of 'navigator:browser'.

SDK way because thats what it looks like you're doing from your comment:

var {Cu} = require("chrome");
Cu.import('resource://gre/modules/Services.jsm');

Services.ww.openWindow(Services.wm.getMostRecentWindow('navigator:browser'), "chrome://browser/content/search/engineManager.xul", "_blank", "chrome,dialog,modal,centerscreen,resizable", null);
Noitidart
  • 35,443
  • 37
  • 154
  • 323
  • 1
    Sure [there is a list](https://developer.mozilla.org/en-US/docs/Web/API/window.open) and it seems to be up-to-date. Passing `modal` isn't required. [Modal windows should be avoided most of the time](http://stackoverflow.com/questions/361493/why-are-modal-dialog-boxes-evil), though. Don't take Stack Overflows opinion for it, there are plenty of guru UX-folks expressing the same opinion, incl. the Mozilla UX folks. – nmaier Jun 29 '14 at 07:33
  • Thanks a lot for that man. That's an awesome list. Yeah modal windows suck I agree, except alerts when debugging, it like holds up the whole process. – Noitidart Jun 29 '14 at 07:48
  • I tested it man, if I don't pass `modal`, its adding a window to the taskbar (im using winxp) – Noitidart Jun 29 '14 at 08:00
  • I didn't say it wouldn't, just wanted to point out that `modal` is considered evil (most of the time). – nmaier Jun 29 '14 at 08:02
  • Is there a way to do non-taskbar showing windows without being modal? Like loading a chrome url in a `deck` that i put in a `panel` or something? – Noitidart Jun 29 '14 at 08:09
  • It does not work. Traded: Components.classes > let {Cc, Ci} = require("chrome");I still do not work. –  Jun 29 '14 at 12:31
  • I fixed it see update, reason it doesn't work is because `window` is not defined in your scope. It's not throwing error because it's fine for first argument of `openWindow` to be `null` or `undefined` or `0`. – Noitidart Jun 29 '14 at 18:38