about:startup - about page implemented as static html/js using the redirector, rather than an independant nsIAboutModule
authorDaniel Brooks <db48x@db48x.net>
Fri, 30 Jul 2010 23:22:57 -0500
changeset 58816 dda9446e1e7dfb7c298dde825bc3519751d04b5b
parent 58815 7ab2c445f7ed9eb421f79bb63b026385c2bb7e78
child 58817 2022273e1553b0f0b79702b4c15a219bb2ade25d
push id17440
push userdb48x@yahoo.com
push dateWed, 08 Dec 2010 04:15:54 +0000
treeherdermozilla-central@a89f24bf1798 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone2.0b3pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
about:startup - about page implemented as static html/js using the redirector, rather than an independant nsIAboutModule
browser/base/content/aboutStartup.html
browser/base/content/aboutStartup.js
browser/base/jar.mn
browser/components/about/AboutRedirector.cpp
new file mode 100755
--- /dev/null
+++ b/browser/base/content/aboutStartup.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <title>App Startup Timing</title>
+  <link rel="stylesheet" href="chrome://global/skin/aboutSupport.css" type="text/css">
+</head>
+<body>
+  <h1>App Startup Timing</h1>
+  <table>
+    <tr><th>Event</th><th>Timestamp</th><th>Elapsed Time</th></tr>
+    <tr><td>Application Launched</td><td id="launched">—</td><td>—</td></tr>
+    <tr><td>Application Started</td><td id="started">—</td><td>—</td></tr>
+    <tr><td>Session Restored</td><td id="restored">—</td><td>—</td></tr>
+  </table>
+  <script type="application/javascript;version=1.8" src="chrome://browser/content/aboutStartup.js"></script>
+</body>
+</html>
new file mode 100755
--- /dev/null
+++ b/browser/base/content/aboutStartup.js
@@ -0,0 +1,7 @@
+var Cc = Components.classes;
+var Ci = Components.interfaces;
+
+var runtime = Cc["@mozilla.org/xre/runtime;1"]
+                .getService(Ci.nsIXULRuntime);
+var started = document.getElementById("started");
+started.textContent = runtime.startupTimestamp
old mode 100644
new mode 100755
--- a/browser/base/jar.mn
+++ b/browser/base/jar.mn
@@ -16,16 +16,18 @@ browser.jar:
 *       content/browser/aboutDialog.xul               (content/aboutDialog.xul)
 *       content/browser/aboutDialog.js                (content/aboutDialog.js)
         content/browser/aboutDialog.css               (content/aboutDialog.css)
 *       content/browser/aboutRobots.xhtml             (content/aboutRobots.xhtml)
         content/browser/aboutRobots-icon.png          (content/aboutRobots-icon.png)
         content/browser/aboutRobots-icon-rtl.png      (content/aboutRobots-icon-rtl.png)
         content/browser/aboutRobots-widget-left.png   (content/aboutRobots-widget-left.png)
         content/browser/aboutRobots-widget-right.png  (content/aboutRobots-widget-right.png)
+        content/browser/aboutStartup.html             (content/aboutStartup.html)
+        content/browser/aboutStartup.js               (content/aboutStartup.js)
 *       content/browser/browser.css                   (content/browser.css)
 *       content/browser/browser.js                    (content/browser.js)
 *       content/browser/browser.xul                   (content/browser.xul)
 *       content/browser/browser-tabPreviews.xml       (content/browser-tabPreviews.xml)
 *       content/browser/credits.xhtml                 (content/credits.xhtml)
 *       content/browser/fullscreen-video.xhtml        (content/fullscreen-video.xhtml)
 *       content/browser/pageinfo/pageInfo.xul         (content/pageinfo/pageInfo.xul)
 *       content/browser/pageinfo/pageInfo.js          (content/pageinfo/pageInfo.js)
old mode 100644
new mode 100755
--- a/browser/components/about/AboutRedirector.cpp
+++ b/browser/components/about/AboutRedirector.cpp
@@ -91,16 +91,18 @@ static RedirEntry kRedirMap[] = {
 #endif
     nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
     nsIAboutModule::ALLOW_SCRIPT },
   { "robots", "chrome://browser/content/aboutRobots.xhtml",
     nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
     nsIAboutModule::ALLOW_SCRIPT },
   { "sessionrestore", "chrome://browser/content/aboutSessionRestore.xhtml",
     nsIAboutModule::ALLOW_SCRIPT },
+  { "startup", "chrome://browser/content/aboutStartup.html",
+    nsIAboutModule::ALLOW_SCRIPT },
 };
 static const int kRedirTotal = NS_ARRAY_LENGTH(kRedirMap);
 
 static nsCAutoString
 GetAboutModuleName(nsIURI *aURI)
 {
   nsCAutoString path;
   aURI->GetPath(path);