Possible breaking change for windowIterator method of window-utils module

6 views
Skip to first unread message

Alexandre poirot

unread,
Jun 7, 2012, 10:13:10 AM6/7/12
to mozilla-labs-jetpack
Hi Rocketeers,

We have just landed a fix against `windowIterator` method exposed in api-utils/window-utils module.
Before this fix, `windowIterator` returned windows that were still loading. But we realized that all addons on AMO were accessing DOM content of windows returned by this iterator. So that it was expected by most of us to return only fully loaded windows.
In parallel, we faced a bug when windowIterator was returning a window still in process of loading.

So that it became obvious that we had to change the default behavior of this method to return only windows whose document is loaded.

We verified that no addons would be concerned by this change, but we don't know about addons hosted outside of AMO,
so please consider taking a look at your usages of windowIterator.

If you want to access to all windows, even the ones that are still loading, please use following code:
  let winUtils = require("api-utils/window/utils"); // Note that this is not api-utils/window-utils module, but a new one.
  winUtils.windows().forEach(function (window) {
   
  });
  // or
  for each (let window in winUtils.windows()) {
 
  }

More information in bug 752631:
https://bugzilla.mozilla.org/show_bug.cgi?id=752631


++
Alex
Reply all
Reply to author
Forward
0 new messages