Re: panel.contentURL appears to not change panel contents

35 views
Skip to first unread message

Bryan Clark

unread,
Sep 28, 2012, 6:16:45 PM9/28/12
to mozilla-la...@googlegroups.com
I filed bug 795490 to track fixing this.

On Friday, September 28, 2012 2:32:28 AM UTC-7, Bryan Clark wrote:
I was just trying to do an experiment with the Panel and feel like I ran into a bug changing the contentURL.  While there is a test for the panel location changing a panel I don't think it actually tests the change in frame contents.

Here's a simple test case of changing contentURL on timeouts
https://builder.addons.mozilla.org/package/154462/latest/

Similar question on Stack Overflow
http://stackoverflow.com/questions/12564758/changing-the-contenturl-of-a-panel-based-on-the-actions-on-the-current-page-rend

And here's the change I found fixed the issue by swapping out the frame loader before the _initFrame call.

diff --git a/packages/addon-kit/lib/panel.js b/packages/addon-kit/lib/panel.js
index edc5581..9832c27 100644
--- a/packages/addon-kit/lib/panel.js
+++ b/packages/addon-kit/lib/panel.js
@@ -354,6 +354,7 @@ const Panel = Symbiont.resolve({
 
   _onChange: function _onChange(e) {
     if ('contentURL' in e && this._frame) {
+      this._frameLoadersSwapped = false;
       // Cleanup the worker before injecting the content script in the new
       // document
       this._workerCleanup();


Are others seeing this as well?

Thanks,
~ Bryan

Jeff Griffiths

unread,
Sep 28, 2012, 8:03:56 PM9/28/12
to mozilla-la...@googlegroups.com, Bryan Clark
This change is now in a pull request:

https://github.com/mozilla/addon-sdk/pull/594

I tested it ( no! really! ) and it seems to wfm.

On 12-09-28 3:16 PM, Bryan Clark wrote:
> I filed bug 795490 <https://bugzilla.mozilla.org/show_bug.cgi?id=795490>
> --
> You received this message because you are subscribed to the Google
> Groups "mozilla-labs-jetpack" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/mozilla-labs-jetpack/-/yRCwdZNdHvYJ.
> To post to this group, send email to mozilla-la...@googlegroups.com.
> To unsubscribe from this group, send email to
> mozilla-labs-jet...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/mozilla-labs-jetpack?hl=en.

Reply all
Reply to author
Forward
0 new messages