Skip to content

Instantly share code, notes, and snippets.

@freaktechnik
Created August 2, 2015 16:24
Show Gist options
  • Select an option

  • Save freaktechnik/6eddb42679832e961ca6 to your computer and use it in GitHub Desktop.

Select an option

Save freaktechnik/6eddb42679832e961ca6 to your computer and use it in GitHub Desktop.
// Ci is a shorthand for Components.interfaces that has to be defined beforehand.
var enumerator; // is a nsISimpleEnumberator
// Adjust the elementInterface to support your needs / what the enumerator actually provides. Feel free to hard code that instead of doing it this way.
var element, elementInterface = "nsISupports";
while(enumerator.hasMoreElements()) {
element = enumerator.getNext().QueryInterface(Ci[elementInterface]);
// do stuff with element
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment