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