Commit 450e77e2 authored by Kathleen Brade's avatar Kathleen Brade Committed by Georg Koppen
Browse files

Bug 16940: After update, load local change notes.

Add an about:tbupdate page that displays the first section from
TorBrowser/Docs/ChangeLog.txt and includes a link to the remote
post-update page (typically our blog entry for the release).

Always load about:tbupdate in a content process, but implement the
code that reads the file system (changelog) in the chrome process
for compatibility with future sandboxing efforts.
parent e7f2bdb2
Loading
Loading
Loading
Loading
+54 −0
Original line number Diff line number Diff line
body {
  font-family: sans-serif;
  font-size: 110%;
  background-image: -moz-linear-gradient(top, #ffffff, #ffffff 10%, #d5ffd5 50%, #d5ffd5);
  background-attachment: fixed;
  background-size: 100% 100%;
}

#torbrowser-version {
  /* These CSS rules match the about:tor page */
  position: fixed;
  top: 6px;
  right: 6px;
  height: 30px;
  width: 200px;
  white-space: pre-wrap;
  text-align: right;
  color: #4d4d4d;
  font-family: "Liberation Sans", Arial, Helvetica, sans-serif;
  font-size: 14px;
}

#logo {
  background-image: url("chrome://browser/content/abouttbupdate/aboutTBUpdateLogo.png");
  height: 128px;
  width: 128px;
  margin: 20px;
  float: left;
}

#msg {
  margin-top: 50px;
  float: left;
}

#msg-updated {
  font-size: 120%;
  font-weight: bold;
  margin-bottom: 20px;
}

#changelog-container {
  margin: 0px 20px 20px 20px;
}

#changelog-heading {
  font-weight: bold;
  margin-bottom: 4px;
}

#changelog {
  margin-left: 20px;
  white-space: pre;
}
+10 −0
Original line number Diff line number Diff line
// Copyright (c) 2015, The Tor Project, Inc.
// See LICENSE for licensing information.
//
// vim: set sw=2 sts=2 ts=8 et syntax=javascript:

function init()
{
  let event = new CustomEvent("AboutTBUpdateLoad", { bubbles: true });
  document.dispatchEvent(event);
}
+36 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html [
  <!ENTITY % htmlDTD
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "DTD/xhtml1-strict.dtd">
  %htmlDTD;
  <!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
  %globalDTD;
  <!ENTITY % tbUpdateDTD SYSTEM "chrome://browser/locale/aboutTBUpdate.dtd">
  %tbUpdateDTD;
]>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>&aboutTBUpdate.title;</title>
  <link rel="stylesheet" type="text/css"
        href="chrome://browser/content/abouttbupdate/aboutTBUpdate.css"/>
  <script src="chrome://browser/content/abouttbupdate/aboutTBUpdate.js"
          type="text/javascript"/>
</head>
<body dir="&locale.dir;" onload="init()">
<div id="torbrowser-version"/>
<div id="logo"/>
<div id="msg">
<div id="msg-updated">&aboutTBUpdate.updated;</div>
<div>&aboutTBUpdate.linkPrefix;<a id="infolink">&aboutTBUpdate.linkLabel;</a>&aboutTBUpdate.linkSuffix;
</div>
</div>
<br clear="all"/>
<div id="changelog-container">
<div id="changelog-heading">&aboutTBUpdate.changeLogHeading;</div>
<div id="changelog"></div>
</div>
</body>
</html>
+22.7 KiB
Loading image diff...
+6 −2
Original line number Diff line number Diff line
@@ -303,6 +303,9 @@ var gInitialPages = [
  "about:welcomeback",
  "about:sessionrestore"
];
if (AppConstants.TOR_BROWSER_UPDATE) {
  gInitialPages.push("about:tbupdate");
}

function isInitialPage(url) {
  return gInitialPages.includes(url) || url == BROWSER_NEW_TAB_URL;
@@ -2760,7 +2763,8 @@ function URLBarSetURI(aURI) {
    // Replace initial page URIs with an empty string
    // only if there's no opener (bug 370555).
    if (isInitialPage(uri.spec) &&
        checkEmptyPageOrigin(gBrowser.selectedBrowser, uri)) {
        checkEmptyPageOrigin(gBrowser.selectedBrowser, uri))
    {
      value = "";
    } else {
      // We should deal with losslessDecodeURI throwing for exotic URIs
@@ -7454,7 +7458,7 @@ var gIdentityHandler = {
   * RegExp used to decide if an about url should be shown as being part of
   * the browser UI.
   */
  _secureInternalUIWhitelist: /^(?:accounts|addons|cache|config|crashes|customizing|downloads|healthreport|license|newaddon|permissions|preferences|rights|searchreset|sessionrestore|support|welcomeback)(?:[?#]|$)/i,
  _secureInternalUIWhitelist: (AppConstants.TOR_BROWSER_UPDATE ? /^(?:accounts|addons|cache|config|crashes|customizing|downloads|healthreport|license|newaddon|permissions|preferences|rights|searchreset|sessionrestore|support|welcomeback|tor|tbupdate)(?:[?#]|$)/i : /^(?:accounts|addons|cache|config|crashes|customizing|downloads|healthreport|license|newaddon|permissions|preferences|rights|searchreset|sessionrestore|support|welcomeback|tor)(?:[?#]|$)/i),

  get _isBroken() {
    return this._state & Ci.nsIWebProgressListener.STATE_IS_BROKEN;
Loading