GILL
GILL

Reputation: 319

Making a panel persist despite click on page opened in browser

I want to achieve this

  1. Anchor a panel to a widget
  2. make it persist
  3. It will only appear or disappear when widget is clicked
  4. or It may be made to disappear by clicking some button on it I want to achieve this because my addon is entirely residing in a panel Here is the addon.

Upvotes: 2

Views: 443

Answers (2)

Thomas Decaux
Thomas Decaux

Reputation: 22671

You mean "noautohide" panel property?

It seems you cannot access to Panel object using the addon SDK, so you can create your own XUL Panel to set noautohide=true.

Upvotes: 0

therealjeffg
therealjeffg

Reputation: 5830

Ok, I looked at this a bit more, and I'd like to apologize for a couple of things:

  1. iframe won't work due to cross-domain security issues. That was a dead end.
  2. I took waaay too long to get back to you, I've been on holiday and the place we were staying at only allowed 30 minutes of wifi per day, per room.

One way to approach this is to load your html directly from the data folder, pass it into the content script and inject it into the page. Something like this:

https://builder.addons.mozilla.org/addon/1043886/latest/

Some usability guidelines for this:

  1. the user should be able to easily and obviously remove the injected content from the page. If you need to preserve the state of the injected content, you'll need to store that before removing the DOM nodes.
  2. the injection should probably only happen when the user makes an action, eg by clicking on a widget. This should at least be the default.
  3. there should be very careful handling of any data that gets sent back to the main.js add-on code from the injected content, as per usual. DO NOT TRUST DATA FROM THE WEB!

Upvotes: 1

Related Questions