1 # -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 # ***** BEGIN LICENSE BLOCK *****
3 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 # The contents of this file are subject to the Mozilla Public License Version
6 # 1.1 (the "License"); you may not use this file except in compliance with
7 # the License. You may obtain a copy of the License at
8 # http://www.mozilla.org/MPL/
10 # Software distributed under the License is distributed on an "AS IS" basis,
11 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 # for the specific language governing rights and limitations under the
15 # The Original Code is mozilla.org code.
17 # The Initial Developer of the Original Code is
19 # Portions created by the Initial Developer are Copyright (C) 2005
20 # the Initial Developer. All Rights Reserved.
23 # Mike Connor <mconnor@steelgryphon.com>
24 # Asaf Romano <mozilla.mano@sent.com>
26 # Alternatively, the contents of this file may be used under the terms of
27 # either the GNU General Public License Version 2 or later (the "GPL"), or
28 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 # in which case the provisions of the GPL or the LGPL are applicable instead
30 # of those above. If you wish to allow use of your version of this file only
31 # under the terms of either the GPL or the LGPL, and not to allow others to
32 # use your version of this file under the terms of the MPL, indicate your
33 # decision by deleting the provisions above and replace them with the notice
34 # and other provisions required by the GPL or the LGPL. If you do not delete
35 # the provisions above, a recipient may use your version of this file under
36 # the terms of any one of the MPL, the GPL or the LGPL.
38 # ***** END LICENSE BLOCK *****
41 var appStartup = Components.classes[
"@mozilla.org/toolkit/app-startup;1"]
42 .getService(Components.interfaces.nsIAppStartup);
43 appStartup.quit(appStartup.eForceQuit | appStartup.eRestart);
47 var prefService = Components.classes[
"@mozilla.org/preferences-service;1"]
48 .getService(Components.interfaces.nsIPrefService);
49 prefService.resetUserPrefs();
53 var fileLocator = Components.classes[
"@mozilla.org/file/directory_service;1"]
54 .getService(Components.interfaces.nsIProperties);
55 const NS_APP_PREFS_OVERRIDE_DIR =
"PrefDOverride";
56 var prefOverridesDir = fileLocator.get(NS_APP_PREFS_OVERRIDE_DIR,
57 Components.interfaces.nsIFile);
58 prefOverridesDir.remove(
true);
60 Components.utils.reportError(ex);
65 var prefBranch = Components.classes[
"@mozilla.org/preferences-service;1"]
66 .getService(Components.interfaces.nsIPrefBranch);
67 prefBranch.setBoolPref(
"browser.bookmarks.restore_default_bookmarks",
true);
71 const nsIDirectoryServiceContractID =
"@mozilla.org/file/directory_service;1";
72 const nsIProperties = Components.interfaces.nsIProperties;
73 var directoryService = Components.classes[nsIDirectoryServiceContractID]
74 .getService(nsIProperties);
75 var localstoreFile = directoryService.get(
"LStoreS", Components.interfaces.nsIFile);
76 if (localstoreFile.exists())
77 localstoreFile.remove(
false);
82 const nsIUpdateItem = Components.interfaces.nsIUpdateItem;
83 var em = Components.classes[
"@mozilla.org/extensions/manager;1"]
84 .getService(Components.interfaces.nsIExtensionManager);
85 var type = nsIUpdateItem.TYPE_EXTENSION + nsIUpdateItem.TYPE_LOCALE;
86 var items = em.getItemList(type, { });
87 for (var
i = 0;
i < items.length; ++
i)
88 em.disableItem(items[
i].id);
91 var prefB = Components.classes[
"@mozilla.org/preferences-service;1"]
92 .getService(Components.interfaces.nsIPrefBranch);
93 if (prefB.prefHasUserValue(
"general.skins.selectedSkin"))
94 prefB.clearUserPref(
"general.skins.selectedSkin");
97 var phs = Components.classes[
"@mozilla.org/plugin/host;1"]
98 .getService(Components.interfaces.nsIPluginHost);
99 var plugins = phs.getPluginTags({ });
100 for (i = 0; i < plugins.length; ++
i)
101 plugins[i].disabled =
true;
105 var searchService = Components.classes[
"@mozilla.org/browser/search-service;1"]
106 .getService(Components.interfaces.nsIBrowserSearchService);
108 searchService.restoreDefaultEngines();
113 if (document.getElementById(
"resetUserPrefs").checked)
115 if (document.getElementById(
"deleteBookmarks").checked)
117 if (document.getElementById(
"resetToolbars").checked)
119 if (document.getElementById(
"disableAddons").checked)
121 if (document.getElementById(
"restoreSearch").checked)
130 var appStartup = Components.classes[
"@mozilla.org/toolkit/app-startup;1"]
131 .getService(Components.interfaces.nsIAppStartup);
132 appStartup.quit(appStartup.eForceQuit);
136 document.getElementById(
"tasks")
141 document.documentElement.getButton(
"accept").disabled =
142 !document.getElementById(
"resetUserPrefs").checked &&
143 !document.getElementById(
"deleteBookmarks").checked &&
144 !document.getElementById(
"resetToolbars").checked &&
145 !document.getElementById(
"disableAddons").checked &&
146 !document.getElementById(
"restoreSearch").checked;
function deleteLocalstore()
function restoreDefaultSearchEngines()
function UpdateOKButtonState()
function restoreDefaultBookmarks()
_getSelectedPageStyle s i