зеркало из https://github.com/mozilla/lightbeam.git
add hooks for info pages after install and upgrade
pages are just stubs for now
This commit is contained in:
Родитель
d1216218b8
Коммит
b4dfbd9d57
|
@ -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>
|
|
@ -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>
|
21
lib/main.js
21
lib/main.js
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче