/usr/share/xul-ext/password-editor/content/firstrun.jsm is in xul-ext-password-editor 2.9.6-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | /*
Saved Password Editor, extension for Gecko applications
Copyright (C) 2016 Daniel Dawson <danielcdawson@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
var EXPORTED_SYMBOLS = [];
const Cc = Components.classes,
Ci = Components.interfaces,
Cu = Components.utils,
FIREFOX = "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}",
SEAMONKEY = "{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}",
THUNDERBIRD = "{3550f703-e582-4d05-9a08-453d09bdfdc6}",
PREFNAME = "currentVersion",
THISVERSION = "2.9.6",
WELCOMEVERSION = "2.5pre1",
CONTENT = "chrome://savedpasswordeditor/content/",
WELCOMEURL = CONTENT + "welcome.xhtml",
WELCOMEURL_SM = CONTENT + "welcome_sm.xhtml";
var timer;
function welcome () {
var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
getService(Ci.nsIWindowMediator),
appId = Cc["@mozilla.org/xre/app-info;1"].
getService(Ci.nsIXULAppInfo).ID;
switch (appId) {
case FIREFOX:
var curWin = wm.getMostRecentWindow("navigator:browser");
curWin.gBrowser.selectedTab = curWin.gBrowser.addTab(WELCOMEURL);
break;
case SEAMONKEY:
var curWin = wm.getMostRecentWindow("navigator:browser");
if (!curWin) {
var cmdLine = {
handleFlagWithParam: function (flag, caseSensitive)
flag == "browser" ? WELCOMEURL_SM : null,
handleFlag: function (flag, caseSensitive) false,
preventDefault: true
};
const clh_prefix =
"@mozilla.org/commandlinehandler/general-startup;1";
Cc[clh_prefix + "?type=browser"].
getService(Ci.nsICommandLineHandler).handle(cmdLine);
} else
curWin.gBrowser.selectedTab = curWin.gBrowser.addTab(WELCOMEURL_SM);
break;
case THUNDERBIRD:
var curWin = wm.getMostRecentWindow("mail:3pane");
curWin.focus();
curWin.document.getElementById("tabmail").openTab(
"contentTab", { contentPage: WELCOMEURL });
break;
}
}
function set_welcome () {
try {
Cu.import("resource:///modules/CustomizableUI.jsm", {});
return; /* Don't do it on Australis */
} catch (e) {}
timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
timer.initWithCallback({ notify: function () { welcome(); } },
500, Ci.nsITimer.TYPE_ONE_SHOT);
}
{
let prefs = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefService).
getBranch("extensions.savedpasswordeditor.");
if (prefs.prefHasUserValue(PREFNAME)) {
let vc = Cc["@mozilla.org/xpcom/version-comparator;1"].
getService(Ci.nsIVersionComparator),
lastVersion = prefs.getCharPref(PREFNAME);
if (vc.compare(lastVersion, WELCOMEVERSION) < 0)
set_welcome();
if (vc.compare(lastVersion, THISVERSION) < 0)
prefs.setCharPref(PREFNAME, THISVERSION);
} else {
set_welcome();
prefs.setCharPref(PREFNAME, THISVERSION);
}
}
|