alwaysLowered results in setting the flag CHROME_WINDOW_LOWERED, or at
least "may" depending on privilege and parent window. The comment near
that code is not reassuring, lumping it in with "features that are more
operating hints than appearance instructions."

http://mxr.mozilla.org/mozilla/source/embedding/components/windowwatcher/src/nsWindowWatcher.cpp#1494

If you can't get it to work when the window is being opened you can
raise or lower it explicitly after it's opened. And you could try to set
the persistent ZLevel after the fact as well. Here's how the help code
tries to do it (you'll want loweredZ rather than raisedZ):

http://mxr.mozilla.org/mozilla/source/toolkit/components/help/content/help.js#781

The help code is explicitly windows-only, so it looks like you're out of
luck on other platforms.

This is not a "security" issue and you'll probably find people with a
lot more knowledge of window controls in an extension-developer group
like mozilla.dev.extensions (or less likely, mozilla.dev.tech.xul).


rael wrote:
> I have thrown in the towel with using a signed script to open a window
> with alwaysLowered.  It seems clear from the firefox source code, and
> from a person on this group (Daniel), that this cannot work and that
> this must be done from a  window that has a "chrome" parent.
> 
> Aside from the obvious gripe (why nobody from the mozilla organization
> bothered to take 5 minutes to document this fact in the Javascript
> documentation on the mozilla site), I am still not seeing any effect
> from using the alwaysLowered feature.
> 
> I downloaded a "helloworld" extension example from MozillaZine (http://
> kb.mozillazine.org/Getting_started_with_extension_development) and
> added to it the opening of three windows, two of which have the
> alwaysLowered feature set.  Essentially, this tutorial installs a new
> menu item underneath the Tools menu titled "Hello World!".  When you
> click on it, it opens a little window with a close button.  I replaced
> the opening of this small window with an open of three windows, as
> above.  Firefox opens the windows, but refuses to place them
> underneath any others on the screen.  Again, I am running this under
> Linux.
> 
> Here is the overlay.js, which I modified from the example:
> 
> var Helloworld = {
>         onLoad: function() {
>                 this.initialized = true;
>         },
> 
>         onMenuItemCommand: function() {
>                 var features = "top=0,left=1," +
>  
> "dependent=yes,menubar=no,location=no,resizable=no"
> 
>                 var tv_features = features +
>                         ",alwaysRaised=yes,width=500,height=200";
> 
>                 var tv_win = window.open("", "tv", tv_features);
> 
>                 var full_features = features +
>                         ",alwaysLowered=yes,width=1000,height=400";
> 
>                 var full_win = window.open("", "full", full_features);
> 
>                 var full_winII = window.open("", "full_II",
> full_features);
>         }
> };
> 
> window.addEventListener("load", function(e) { Helloworld.onLoad(e); },
> false);
> 
> I tried coding the above with an added variety of calls to the
> PrivilegeManager to no avail --- I do believe that an extension is
> granted these by default anyway, but I'm trying anything to get this
> to work.  I also put working URLs in each of the window.open calls
> above, and they load just fine, but still no lowering of any sort
> happens.  I also tried using the tv_win to open the other windows, but
> that didn't work (no lowering) either.
> 
> So, what am I doing incorrectly?  Is this alwaysLowered feature
> something that someone, somewhere on this planet has ever used
> successfully?
> 
> 
> Bill
_______________________________________________
dev-security mailing list
dev-security@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-security

Reply via email to