Closed Bug 1153096 Opened 9 years ago Closed 9 years ago

Panels in Jetpack SDK can't be prevented from hiding

Categories

(Add-on SDK Graveyard :: General, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 595040

People

(Reporter: pbroman, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36

Steps to reproduce:

According to https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/PopupGuide/PopupEvents, it should be possible to call 'e.preventDefault' on the popuphiding event for a domPanel to prevent it from autohiding.

A few months ago this worked when used on a Jetpack SDK panel (sdk/ui/panel)- we were able to prevent panels from autohiding by calling e.preventDefault on the popuphiding event for the panel.  However, now that we have another use for this functionality I have discovered that this no longer worked in FF37 (and may have been introduced earlier).   I am unfortunately not sure what version of FF I was using when this was possible.

Yahoo would like to use this functionality to create persistent panels that don't close until they are closed by the user, for some extensions we are working on. 


Actual results:

Calling e.preventDefault on the popuphiding event for a SDK panel (sdk/ui/panel) does nothing, whereas a few builds ago it successfully stopped a popup autohide.


Expected results:

We would like the ability for this to be possible (calling e.preventDefault on the popuphiding event an SDK panel (sdk/ui/panel) to stop it from autohiding).
Component: Untriaged → General
Product: Firefox → Add-on SDK
Version: 37 Branch → unspecified
Preventing the panel from hiding isn't something we've ever wanted to support in the SDK (see bug 595040). I did some bisecting and found that using event.preventDefault to stop the panel from hiding entirely seems to have broken sometime around Firefox 31 (https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=8883360b1edb&tochange=5811efc11011 to be specific) but even before that even though the panel wouldn't hide the contents would disappear when clicking elsewhere so it was mostly broken before then too. I couldn't figure out if that ever worked, I got back to Firefox 24 and it was still not working so if this is a regression it has been around for an awfully long time.

What has worked since then and still works today is simply calling setAttribute("noautohide", "true") on the XUL panel in question. As I say we're not likely to support this in the SDK itself but I wouldn't expect that to change much in the future.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
Could someone give me a code sample of how to set noautohide for my panel?

var panel = require("sdk/panel").Panel({
contentURL: './html/unlock.html',
contentScriptWhen: 'start',
});

panel.show();
You need to log in before you can comment on or make changes to this bug.