blob: a4f04d165b422c0d52f881681c4da4c78e3a7713 (
plain)
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
|
<!-- $Id$ -->
<html>
<head>
<title>Redirector Log Message Listener
<style type="text/css">
body { font-family:Arial, sans-serif; }
</style>
</head>
<body onunload="unload();" onload="load();">
<script>
var listener = {
observe : function(msg) {
var prefix = 'REDIRECTOR:';
if (msg.message.substr(0, prefix.length) == prefix)
{
if (document) {
document.body.innerHTML += msg.message.substr(prefix.length) + '<br>';
} else {
//Been destroyed and we're still getting message, lets try to unsubscribe...
try { unload(); } catch(e) {}
}
}
}
};
var consoleService = Components.classes["@mozilla.org/consoleservice;1"].getService(Components.interfaces.nsIConsoleService);
function load() {
consoleService.registerListener(listener);
}
function unload() {
consoleService.unregisterListener(listener);
}
</script>
</body>
</html>
|