1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 * This script is intended to be run using xpcshell
9 const nsIWindowsRegKey = Ci.nsIWindowsRegKey;
10 const BASE_PATH = "SOFTWARE\\Mozilla\\Firefox";
12 function idump(indent, str) {
13 for (var j = 0; j < indent; ++j) {
19 function list_values(indent, key) {
21 var count = key.valueCount;
22 for (var i = 0; i < count; ++i) {
23 var vn = key.getValueName(i);
25 if (key.getValueType(vn) == nsIWindowsRegKey.TYPE_STRING) {
26 val = key.readStringValue(vn);
29 idump(indent + 1, '(Default): "' + val + '"\n');
31 idump(indent + 1, vn + ': "' + val + '"\n');
37 function list_children(indent, key) {
38 list_values(indent, key);
40 var count = key.childCount;
41 for (var i = 0; i < count; ++i) {
42 var cn = key.getChildName(i);
43 idump(indent, "[" + cn + "]\n");
44 list_children(indent + 1, key.openChild(cn, nsIWindowsRegKey.ACCESS_READ));
48 // enumerate everything under BASE_PATH
50 Cc["@mozilla.org/windows-registry-key;1"].createInstance(nsIWindowsRegKey);
52 nsIWindowsRegKey.ROOT_KEY_LOCAL_MACHINE,
54 nsIWindowsRegKey.ACCESS_READ
56 list_children(1, key);
60 nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
62 nsIWindowsRegKey.ACCESS_READ
64 list_children(1, key);