Making a panel persist despite click on page opened in browser

我怕爱的太早我们不能终老 提交于 2019-12-11 02:56:47

问题


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.

回答1:


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!



回答2:


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.



来源:https://stackoverflow.com/questions/9328471/making-a-panel-persist-despite-click-on-page-opened-in-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!