1 | /* ***** BEGIN LICENSE BLOCK ***** |
---|
2 | This program is free software; you can redistribute it and/or modify |
---|
3 | it under the terms of the GNU General Public License as published by |
---|
4 | the Free Software Foundation; either version 2 of the License, or |
---|
5 | (at your option) any later version. |
---|
6 | |
---|
7 | This program is distributed in the hope that it will be useful, |
---|
8 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
10 | GNU General Public License for more details. |
---|
11 | |
---|
12 | You should have received a copy of the GNU General Public License |
---|
13 | along with this program; if not, write to the Free Software |
---|
14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
15 | |
---|
16 | The Original Code is the Virtual Identity Extension. |
---|
17 | |
---|
18 | The Initial Developer of the Original Code is Rene Ejury. |
---|
19 | Portions created by the Initial Developer are Copyright (C) 2007 |
---|
20 | the Initial Developer. All Rights Reserved. |
---|
21 | |
---|
22 | Contributor(s): |
---|
23 | * ***** END LICENSE BLOCK ***** */ |
---|
24 | |
---|
25 | virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { |
---|
26 | var upgradeOverlay = { |
---|
27 | init: function() { |
---|
28 | var rdfDatasource = new vI.rdfDatasource("virtualIdentity.rdf", true); |
---|
29 | if (rdfDatasource.extUpgradeRequired()) { |
---|
30 | if (!vI.upgrade.quick_upgrade(rdfDatasource.getCurrentExtFileVersion())) |
---|
31 | window.open("chrome://v_identity/content/vI_upgrade.xul",0, |
---|
32 | "chrome, dialog, modal, alwaysRaised, resizable=yes").focus(); |
---|
33 | } |
---|
34 | else { |
---|
35 | vI.account.cleanupSystem(); // always clean leftover accounts and directories |
---|
36 | rdfDatasource.storeExtVersion(); |
---|
37 | } |
---|
38 | rdfDatasource.refreshAccountInfo(); |
---|
39 | rdfDatasource.clean(); |
---|
40 | |
---|
41 | // show error-Console if required |
---|
42 | var prefroot = Components.classes["@mozilla.org/preferences-service;1"] |
---|
43 | .getService(Components.interfaces.nsIPrefService) |
---|
44 | .getBranch(null); |
---|
45 | |
---|
46 | Components.utils.import("resource://gre/modules/AddonManager.jsm"); |
---|
47 | |
---|
48 | const switch_signature_ID="{2ab1b709-ba03-4361-abf9-c50b964ff75d}" |
---|
49 | prefroot.setBoolPref("extensions.virtualIdentity." + switch_signature_ID, false) |
---|
50 | AddonManager.getAddonByID(switch_signature_ID, function(addon) { |
---|
51 | if (addon) prefroot.setBoolPref("extensions.virtualIdentity." + switch_signature_ID, addon.userDisabled || addon.appDisabled ? false : true) |
---|
52 | }); |
---|
53 | |
---|
54 | const enigmail_ID="{847b3a00-7ab1-11d4-8f02-006008948af5}" |
---|
55 | prefroot.setBoolPref("extensions.virtualIdentity." + enigmail_ID, false) |
---|
56 | AddonManager.getAddonByID(enigmail_ID, function(addon) { |
---|
57 | if (addon) prefroot.setBoolPref("extensions.virtualIdentity." + enigmail_ID, addon.userDisabled || addon.appDisabled ? false : true) |
---|
58 | }); |
---|
59 | |
---|
60 | const virtualIdentity_ID="{dddd428e-5ac8-4a81-9f78-276c734f75b8}" |
---|
61 | AddonManager.getAddonByID(virtualIdentity_ID, function(addon) { |
---|
62 | if (addon) vI.extensionVersion = addon.version; |
---|
63 | }); |
---|
64 | |
---|
65 | if (prefroot.getBoolPref("extensions.virtualIdentity.error_console")) { |
---|
66 | document.getElementById("vIErrorBoxSplitter").removeAttribute("hidden"); |
---|
67 | document.getElementById("vIErrorBox").removeAttribute("hidden"); |
---|
68 | document.getElementById("vIErrorBox").setAttribute("class", "console-box"); |
---|
69 | prefroot.setBoolPref("javascript.options.showInConsole", true); |
---|
70 | prefroot.setBoolPref("browser.dom.window.dump.enabled", true); |
---|
71 | prefroot.setBoolPref("javascript.options.strict", true); |
---|
72 | } |
---|
73 | } |
---|
74 | } |
---|
75 | addEventListener('messagepane-loaded', upgradeOverlay.init, true); |
---|
76 | }}); |
---|