Add an html file that can be used to install the xpi
git-svn-id: svn://10.0.0.236/trunk@73265 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -313,5 +313,5 @@ endif
|
||||
cp $(INSTALL_JS) xpi/install.js
|
||||
cd xpi; zip -T -r ../$(PLATFORM)/psm.xpi psm install.js
|
||||
rm -rf xpi
|
||||
|
||||
$(NSINSTALL) -m 644 moz-install.html $(PLATFORM)
|
||||
|
||||
|
||||
79
mozilla/security/psm/server/moz-install.html
Normal file
79
mozilla/security/psm/server/moz-install.html
Normal file
@@ -0,0 +1,79 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Sample PSM xpi install for Mozilla</title>
|
||||
<script>
|
||||
|
||||
var xpi = new Object();
|
||||
var numxpi = 0;
|
||||
var numstatus = 0;
|
||||
|
||||
function showprops(obj) {
|
||||
var props = "";
|
||||
for (i in obj) {
|
||||
props += i+":"+obj[i]+"\n ";
|
||||
}
|
||||
alert(props);
|
||||
}
|
||||
|
||||
function statusCallback(url,status) {
|
||||
for (i in xpi) {
|
||||
if ( url.indexOf(xpi[i]) != -1 ) {
|
||||
xpi[i] = status;
|
||||
numstatus++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// if we've gotten all results then display them
|
||||
if (numstatus == numxpi)
|
||||
{
|
||||
var text;
|
||||
var restart = false;
|
||||
dlg = window.open("","resultWindow");
|
||||
dlg.document.write("<head><title>XPInstall Results</title></head>");
|
||||
dlg.document.write("<body><h1>XPInstall Results</h1>");
|
||||
for (i in xpi)
|
||||
{
|
||||
text = " "+i+": ";
|
||||
switch (status) {
|
||||
case 999:
|
||||
restart = true; // fall-through
|
||||
case 0:
|
||||
text += "Successful";
|
||||
break;
|
||||
default:
|
||||
text += "Error encountered -- "+status;
|
||||
break;
|
||||
}
|
||||
text += "<br>";
|
||||
dlg.document.write(text);
|
||||
}
|
||||
if (restart) {
|
||||
dlg.document.write("<p>Some files were in use, you must restart to complete the installation");
|
||||
}
|
||||
|
||||
dlg.document.write("</body>");
|
||||
dlg.document.close();
|
||||
}
|
||||
}
|
||||
|
||||
function launch()
|
||||
{
|
||||
|
||||
xpi["PSM"] = "psm.xpi";
|
||||
numxpi ++;
|
||||
|
||||
// showprops(xpi);
|
||||
InstallTrigger.install(xpi,statusCallback);
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
Click on this button to install the sample PSM xpi file for Mozilla.
|
||||
<form name="installForm">
|
||||
<input type=button onClick="launch();" value="Install PSM for Mozilla">
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user