Bug 565508 - Remove the ugly hacks for copying the right thing from about:privatebrowsing once
bug 39098 is fixed; r=dao
--- a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml
+++ b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml
@@ -48,16 +48,22 @@
<!ENTITY % privatebrowsingpageDTD SYSTEM "chrome://browser/locale/aboutPrivateBrowsing.dtd">
%privatebrowsingpageDTD;
]>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="chrome://global/skin/netError.css" type="text/css" media="all"/>
<link rel="stylesheet" href="chrome://browser/skin/aboutPrivateBrowsing.css" type="text/css" media="all"/>
+ <style type="text/css"><![CDATA[
+ body.normal .showPrivate,
+ body.private .showNormal {
+ display: none;
+ }
+ ]]></style>
<script type="application/javascript;version=1.7"><![CDATA[
const Cc = Components.classes;
const Ci = Components.interfaces;
var pb = Cc["@mozilla.org/privatebrowsing;1"].
getService(Ci.nsIPrivateBrowsingService);
if (!pb.privateBrowsingEnabled) {
@@ -91,29 +97,19 @@
icon.setAttribute("rel", "icon");
icon.setAttribute("type", "image/png");
icon.setAttribute("href", url);
var head = document.getElementsByTagName("head")[0];
head.insertBefore(icon, head.firstChild);
}
document.addEventListener("DOMContentLoaded", function () {
- let selector;
if (!pb.privateBrowsingEnabled) {
document.body.setAttribute("class", "normal");
- selector = ".showPrivate";
}
- else {
- selector = ".showNormal";
- }
-
- // Remove hidden elements to avoid bug 39098
- let elements = document.body.querySelectorAll(selector);
- for (let i = 0; i < elements.length; ++ i)
- elements[i].parentNode.removeChild(elements[i]);
// Set up the help link
let moreInfoURL = Cc["@mozilla.org/toolkit/URLFormatterService;1"].
getService(Ci.nsIURLFormatter).
formatURLPref("app.support.baseURL");
let moreInfoLink = document.getElementById("moreInfoLink");
if (moreInfoLink)
moreInfoLink.setAttribute("href", moreInfoURL + "private-browsing");