/usr/share/xul-ext/all-in-one-sidebar/content/pageinfo.js is in xul-ext-all-in-one-sidebar 0.7.23-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 | var aios_inSidebar = (top.document.getElementById('sidebar-box')) ? true : false;
var aios_inTab = (AiOS_HELPER.mostRecentWindow.aiosLastSelTab) ? true : false;
// Listener fuer automatische Aktualisierung hinzufuegen u. entfernen
if(aios_inSidebar) {
window.addEventListener("load", function(e) {
top.gBrowser.addProgressListener(aiosProgListener);
}, false);
window.addEventListener("unload",function(e) {
top.gBrowser.removeProgressListener(aiosProgListener);
}, false);
}
function aios_init() {
// Menueleiste unter Mac OS X ausblenden
aios_hideMacMenubar();
// fuer CSS-Zwecke speichern
AiOS_HELPER.rememberAppInfo( document.getElementById('main-window') );
try {
var enable_layout = AiOS_HELPER.prefBranchAiOS.getBoolPref("pi.layout");
var enable_layoutall = AiOS_HELPER.prefBranchAiOS.getBoolPref("pi.layoutall");
if((enable_layout && aios_inSidebar) || enable_layoutall) aios_sidebarLayout();
}
catch(e) { }
// Tastaturkuerzel entfernen, um nicht die des Hauptbrowsers zu blockieren
if(aios_inSidebar) aios_removeAccesskeys();
//alert(document.getElementById('topBar').clientWidth);
//document.getElementById('metatree').getElementsByTagName('treechildren')[0].style.maxWidth = document.getElementById('topBar').clientWidth + "px";
}
function aios_sidebarLayout() {
var vbox;
// CSS fuer Sidebar-Optimierungen aktivieren
aios_addCSS("pageinfo.css", "main-window");
// Label der Radio-Buttons unsichtbar machen => nur wenn es Icons gibt
var cStyle = document.defaultView.getComputedStyle(document.getElementById('generalTab'), '');
if(cStyle.listStyleImage && cStyle.listStyleImage != "none") {
if(document.getElementById('viewGroup')) document.getElementById('viewGroup').setAttribute("hideLabel", true);
}
// Radio-Buttons mit Tooltip
if(document.getElementById('viewGroup')) {
var radioChilds = document.getElementById('viewGroup').childNodes;
for(var i = 0; i < radioChilds.length; i++) {
if(radioChilds[i].tagName == "radio") radioChilds[i].setAttribute('tooltiptext', radioChilds[i].label);
}
}
// Media-Panel: Save as... button umbrechen
var hbox = document.getElementById('mediaPreviewBox').getElementsByTagName('hbox')[0];
hbox.setAttribute('align', 'start');
hbox.setAttribute('orient', 'vertical');
hbox.removeChild(hbox.getElementsByTagName('spacer')[0]);
hbox.appendChild(hbox.getElementsByTagName('vbox')[0]);
// Security-Panel: Texte und Buttons umbrechen
// Identity
var groupbox = document.getElementById('security-identity-groupbox');
groupbox.removeChild(groupbox.getElementsByTagName('spacer')[0]);
groupbox.getElementsByTagName('hbox')[0].setAttribute('orient', 'vertical');
groupbox.getElementsByTagName('hbox')[0].setAttribute('align', 'start');
// History
var historyrow = document.getElementById('security-privacy-history-label').parentNode;
vbox = document.createElement("vbox");
while(historyrow.childNodes.length != 0) {
vbox.appendChild(historyrow.firstChild);
}
vbox.setAttribute('flex', '100');
historyrow.appendChild(vbox);
// Cookies
var cookierow = document.getElementById('security-privacy-cookies-label').parentNode;
vbox = document.createElement("vbox");
while(cookierow.childNodes.length != 0) {
vbox.appendChild(cookierow.firstChild);
}
vbox.setAttribute('flex', '100');
cookierow.appendChild(vbox);
// Passwords
var pwdrow = document.getElementById('security-privacy-passwords-label').parentNode;
vbox = document.createElement("vbox");
while(pwdrow.childNodes.length != 0) {
vbox.appendChild(pwdrow.firstChild);
}
vbox.setAttribute('flex', '100');
pwdrow.appendChild(vbox);
}
// automatische Aktualisierung => Aufruf durch aiosProgListener (_helper.js)
function aios_onLocationChange() {
if(aios_inSidebar) {
aios_persistSelTab();
location.reload();
}
}
function aios_onStateChange() {
aios_onLocationChange();
}
// letzten selektierten Tab merken
function aios_persistSelTab() {
document.getElementById('main-window').setAttribute("seltab", document.getElementById('viewGroup').selectedIndex);
}
/* Called when PageInfo window is loaded. Arguments are:
* window.arguments[0] - (optional) an object consisting of
* - doc: (optional) document to use for source. if not provided,
* the calling window's document will be used
* - initialTab: (optional) id of the inital tab to display
*/
function onLoadPageInfo() {
gBundle = document.getElementById("pageinfobundle");
gStrings.unknown = gBundle.getString("unknown");
gStrings.notSet = gBundle.getString("notset");
gStrings.mediaImg = gBundle.getString("mediaImg");
gStrings.mediaBGImg = gBundle.getString("mediaBGImg");
gStrings.mediaObject = gBundle.getString("mediaObject");
gStrings.mediaEmbed = gBundle.getString("mediaEmbed");
gStrings.mediaLink = gBundle.getString("mediaLink");
gStrings.mediaInput = gBundle.getString("mediaInput");
//@line 292 "e:\builds\moz2_slave\rel-cen-w32-bld\build\browser\base\content\pageinfo\pageInfo.js"
gStrings.mediaVideo = gBundle.getString("mediaVideo");
gStrings.mediaAudio = gBundle.getString("mediaAudio");
//@line 295 "e:\builds\moz2_slave\rel-cen-w32-bld\build\browser\base\content\pageinfo\pageInfo.js"
var args = "arguments" in window &&
window.arguments.length >= 1 &&
window.arguments[0];
// mod by eXXile
if(aios_inSidebar) {
var aios_sidebar = top.document.getElementById('sidebar-box');
var aios_window = document.getElementById('main-window');
gDocument = AiOS_HELPER.mostRecentWindow.content.document;
gWindow = AiOS_HELPER.mostRecentWindow.content.window;
}
else if(aios_inTab) {
gDocument = AiOS_HELPER.mostRecentWindow.aiosLastSelTab.document;
gWindow = AiOS_HELPER.mostRecentWindow.content.window;
}
// Original-FF-Teil
else {
if (!args || !args.doc) {
gWindow = window.opener.content;
gDocument = gWindow.document;
}
}
// init media view
var imageTree = document.getElementById("imagetree");
imageTree.view = gImageView;
/* Select the requested tab, if the name is specified */
loadTab(args);
Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService)
.notifyObservers(window, "page-info-dialog-loaded", null);
}
var security = {
// Display the server certificate (static)
viewCert : function () {
var cert = security._cert;
//viewCertHelper(window, cert);
// mod by eXXile
if(aios_inSidebar) viewCertHelper(AiOS_HELPER.mostRecentWindow.content.window, cert);
else if(aios_inTab) viewCertHelper(AiOS_HELPER.mostRecentWindow.aiosLastSelTab.window, cert);
else viewCertHelper(window, cert);
// endmod by eXXile
},
_getSecurityInfo : function() {
const nsIX509Cert = Components.interfaces.nsIX509Cert;
//mod by exxile const nsIX509CertDB = Components.interfaces.nsIX509CertDB;
const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
const nsISSLStatusProvider = Components.interfaces.nsISSLStatusProvider;
const nsISSLStatus = Components.interfaces.nsISSLStatus;
// We don't have separate info for a frame, return null until further notice
// (see bug 138479)
if (gWindow != gWindow.top)
return null;
var hName = null;
try {
hName = gWindow.location.host;
}
catch (exception) { }
var ui = security._getSecurityUI();
if (!ui)
return null;
var isBroken =
(ui.state & Components.interfaces.nsIWebProgressListener.STATE_IS_BROKEN);
var isInsecure =
(ui.state & Components.interfaces.nsIWebProgressListener.STATE_IS_INSECURE);
var isEV =
(ui.state & Components.interfaces.nsIWebProgressListener.STATE_IDENTITY_EV_TOPLEVEL);
ui.QueryInterface(nsISSLStatusProvider);
var status = ui.SSLStatus;
if (!isInsecure && status) {
status.QueryInterface(nsISSLStatus);
var cert = status.serverCert;
var issuerName =
this.mapIssuerOrganization(cert.issuerOrganization) || cert.issuerName;
var retval = {
hostName : hName,
cAName : issuerName,
encryptionAlgorithm : undefined,
encryptionStrength : undefined,
isBroken : isBroken,
isEV : isEV,
cert : cert,
fullLocation : gWindow.location
};
try {
retval.encryptionAlgorithm = status.cipherName;
retval.encryptionStrength = status.secretKeyLength;
}
catch (e) {
}
return retval;
} else {
return {
hostName : hName,
cAName : "",
encryptionAlgorithm : "",
encryptionStrength : 0,
isBroken : isBroken,
isEV : isEV,
cert : null,
fullLocation : gWindow.location
};
}
},
// Find the secureBrowserUI object (if present)
_getSecurityUI : function() {
// mod by eXXile
if(aios_inSidebar) {
if("gBrowser" in top) return top.gBrowser.securityUI;
return null;
}
else if(aios_inTab) {
return AiOS_HELPER.mostRecentWindow.aiosLastSelTab.securityUI;
}
// Original-FF-Teil
else {
if (window.opener.gBrowser) return window.opener.gBrowser.securityUI;
return null;
}
},
// Interface for mapping a certificate issuer organization to
// the value to be displayed.
// Bug 82017 - this implementation should be moved to pipnss C++ code
mapIssuerOrganization: function(name) {
if (!name) return null;
if (name == "RSA Data Security, Inc.") return "Verisign, Inc.";
// No mapping required
return name;
},
/**
* Open the cookie manager window
*/
viewCookies : function() {
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);
var win = wm.getMostRecentWindow("Browser:Cookies");
var eTLDService = Components.classes["@mozilla.org/network/effective-tld-service;1"].
getService(Components.interfaces.nsIEffectiveTLDService);
var eTLD;
var uri = gDocument.documentURIObject;
try {
eTLD = eTLDService.getBaseDomain(uri);
}
catch (e) {
// getBaseDomain will fail if the host is an IP address or is empty
eTLD = uri.asciiHost;
}
if (win) {
win.gCookiesWindow.setFilter(eTLD);
win.focus();
}
else
window.openDialog("chrome://browser/content/preferences/cookies.xul",
"Browser:Cookies", "", {
filterString : eTLD
});
},
/**
* Open the login manager window
*/
viewPasswords : function() {
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);
var win = wm.getMostRecentWindow("Toolkit:PasswordManager");
if (win) {
win.setFilter(this._getSecurityInfo().hostName);
win.focus();
}
else
window.openDialog("chrome://passwordmgr/content/passwordManager.xul",
"Toolkit:PasswordManager", "",
{
filterString : this._getSecurityInfo().hostName
});
},
_cert : null
};
|