Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.
var enumerator = document.getElementById('aStringBundleID').strings;
var s = "";
while (enumerator.hasMoreElements()) {
var property = enumerator.getNext().QueryInterface(Components.interfaces.nsIPropertyElement);
s += property.key + ' = ' + property.value + ';\n';
}
alert(s);
// creates a generator iterating over enum's values
function generatorFromSimpleEnumerator(enum, interface) {
while (enum.hasMoreElements()) {
yield enum.getNext().QueryInterface(interface);
}
}
var b = document.getElementById("stringbundleset").firstChild
var props = generatorFromEnumerator(b.strings, Components.interfaces.nsIPropertyElement);
var s = "";
for (let property in props) {
s += property.key + ' = ' + property.value + ';\n';
}
alert(s);