add hooks for info pages after install and upgrade

pages are just stubs for now
This commit is contained in:
Garrett Robinson 2014-02-13 01:30:43 -08:00
Родитель d1216218b8
Коммит b4dfbd9d57
3 изменённых файлов: 38 добавлений и 3 удалений

10
data/first-run.html Normal file
Просмотреть файл

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Welcome to Lightbeam!</title>
</head>
<body>
<h1>Lightbeam First-Run</h1>
</body>
</html>

10
data/upgrade.html Normal file
Просмотреть файл

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Thanks for upgrading Lightbeam!</title>
</head>
<body>
<h1>Lightbeam Upgrade</h1>
</body>
</html>

Просмотреть файл

@ -7,6 +7,9 @@ const { Connection, addConnection } = require('./connection');
const tabEvents = require('./tab/events');
const ui = require('./ui');
var tabs = require("sdk/tabs");
var data = require("sdk/self").data;
// This is the heart of Lightbeam, we get all of our data from observing these
// requests.
events.on("http-on-examine-response", function(subject) {
@ -42,6 +45,18 @@ PageMod({
onAttach: ui.attachToLightbeamPage
});
exports.main = function (options, callbacks) {
//console.error("options.loadReason:", options.loadReason);
var loadURL = null;
switch (options.loadReason) {
case "install":
loadURL = "first-run.html";
break;
case "upgrade":
loadURL = "upgrade.html";
break;
}
if (loadURL) {
tabs.open(data.url(loadURL));
}
}