Closed
Bug 666117
Opened 15 years ago
Closed 13 years ago
Widget displays icon after open then close of Customize Toolbar dialog
Categories
(Add-on SDK Graveyard :: General, defect, P2)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: grbradt, Unassigned)
References
Details
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0
Build Identifier:
If a widget is displaying content, it changes to icon display on open/close of Customize Toolbar dialog.
Reproducible: Always
Steps to Reproduce:
1. Widget displays content
2. Open Customize Toolbar dialog
3. Close Customize Toolbar dialog
Actual Results:
Widget now displays icon
Expected Results:
Widget should resume content display
Comment 1•15 years ago
|
||
Alex: is this a dupe of a bug you're working on? Or perhaps it's a related bug?
Whiteboard: [triage:followup]
Comment 2•15 years ago
|
||
(In reply to comment #1)
> Alex: is this a dupe of a bug you're working on? Or perhaps it's a related
> bug?
This is same topic than bug 660860. Same piece of code is concerned by these two bugs.
This one is focused on the very first step of toolbar customization, where every toolbaritems are wrapped into toolbarpaletteitems. That leads to iframe reloads. I fixed symbiont destruction/renewal in a previous bug, so that we receive a `detach` event when such reload occurs and we recreate a new symbiont.
I think that the issue here is that:
1/ you didn't expected to have to handle such complex situation where you have to rebuild your widget content on customization,
2/ if you didn't initiated content building from the document load event, (e.g. if you need an addon event to be sent to the content script to start building it). For now, you can't receive any event from the SDK that tells you "hey widget has been reloaded, you have to rebuild content again!".
Regarding how customization works in Firefox, I can tell that we can't avoid these reloads :( (Unless we modify Firefox codebase, but this is an hard move)
I'm proposing in bug 660860 to have only one reload that occurs after customization (by default there would be one on start, and one on end of customization). But the current patch doesn't solve this particular bug.
So here is how I would improve it to ease handling these reloads:
- when customization start, detach event is dispatched and every WidgetView are destroyed,
(currently WidgetView stay "alive", only internal symbiont is reloaded)
- during customization, widget are replaced by a simplier toobarbutton that can't be modified. This toolbarbutton is going to end up in customize dialog.
(already implemented in bug 660860's patch)
- then, on customization end, widget that are still in a toolbar are recreated by creating a new WidgetView and firing a new `attach` event
myk: your feedback would be appreciated, as it may lead to API changes.
Updated•15 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P2
Whiteboard: [triage:followup]
Target Milestone: --- → 1.1
Is this still happening? My Jetpack add-on sets a widget's content to be <img src=someDataURI"/>, and I can enter/exit Customize mode without a problem. (The image flickers for a second right when the dialog opens and closes, but it stays with the correct image.)
I'm running Firefox 8 nightlies, maybe a platform change fixed this?
Hi, to clarify, I have a widget that can display an icon, or text (but not both at the same time). When it is displaying text, then the bug occurs when opening/closing Customize Toolbar.
If you want to see, the add-on is called Canadian Weather at
https://addons.mozilla.org/en-US/firefox/addon/canadian-weather/
Install, and the widget is a sun icon. Right-click to display Options panel, and click Ok button (no need to set any options). Now the widget shows a temperature. Open/close the Customize Toolbar dialog, widget shows sun icon again.
Widget content: <img id="image" src="' + CanWeather.data.url('images/sunny16.png') +
'" style="cursor:pointer;"/><span id="text" style="white-space: pre; padding-left: 10px; padding-right: 10px; font-family: Segoe UI; font-size: 12px; cursor: pointer;"></span>
The widget content script will show/hide the img and span elements as required.
I didn't find any other add-ons to use as an example, but this seems to work.
Also tested on 0730 nightly.
Comment 5•15 years ago
|
||
(Assigning this to myself so I don't lose track of the feedback request here.)
Assignee: nobody → myk
(Pushing all open bugs to the --- milestone for the new triage system)
Target Milestone: 1.1 → ---
Comment 7•15 years ago
|
||
Unassigning myself from bugs I am not actively working on.
Assignee: myk → nobody
Update: I changed my widget content to use a canvas element. Not only did this simplify things, but this bug magically disappeared. Wut? Using SDK 1.3. Resolved as far as I'm concerned.
Updated•13 years ago
|
Blocks: sdk/widget
Comment 9•13 years ago
|
||
When Australis lands widget will be deprecated so we won't be working on this.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•