This is just some static backup of the original site, don't expect every link to work!

source: content/vI_overlay.js

ng_0.9 0.10.3
Last change on this file was f2a2d5, checked in by rene <rene@…>, 4 years ago

moved reading of rdf to add AccountManager? observer

  • Property mode set to 100644
File size: 2.7 KB
Line 
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) 2011
20    the Initial Developer. All Rights Reserved.
21
22    Contributor(s):
23 * ***** END LICENSE BLOCK ***** */
24
25Components.utils.import("resource://v_identity/vI_nameSpaceWrapper.js");
26virtualIdentityExtension.ns(function () {
27  with(virtualIdentityExtension.LIB) {
28
29    let Log = vI.setupLogging("virtualIdentity.overlay");
30    var rdfDatasource;
31   
32    Components.utils.import("resource://v_identity/vI_rdfDatasource.js", virtualIdentityExtension);
33    Components.utils.import("resource://v_identity/vI_account.js", virtualIdentityExtension);
34    Components.utils.import("resource://v_identity/vI_prefs.js", virtualIdentityExtension);
35
36    Components.utils.import("resource://gre/modules/AddonManager.jsm");
37
38    const virtualIdentity_ID = "{dddd428e-5ac8-4a81-9f78-276c734f75b8}"
39    AddonManager.getAddonByID(virtualIdentity_ID, function (addon) {
40      if (addon) {
41        vI.extensionVersion = addon.version;
42      }
43    });
44
45
46    function extensionInit() {
47      rdfDatasource = new vI.rdfDatasource(window, "virtualIdentity_0.10.rdf", false); // create this for upgrade and keep it to permanatly enable accountManager observer
48      vI.upgrade.quickUpgrade(rdfDatasource);
49
50      if (vI.vIprefs.get("error_console")) {
51        document.getElementById("virtualIdentityExtension_vIErrorBoxSplitter").removeAttribute("hidden");
52        document.getElementById("virtualIdentityExtension_vIErrorBox").removeAttribute("hidden");
53        document.getElementById("virtualIdentityExtension_vIErrorBox").setAttribute("class", "console-box");
54        vI.prefroot.setBoolPref("javascript.options.showInConsole", true);
55        vI.prefroot.setBoolPref("browser.dom.window.dump.enabled", true);
56        vI.prefroot.setBoolPref("javascript.options.strict", true);
57      }
58    }
59
60    addEventListener('messagepane-loaded', extensionInit, true);
61  }
62});
Note: See TracBrowser for help on using the repository browser.