/usr/lib/thunderbird-addons/extensions/{a62ef8ec-5fdc-40c2-873c-223b8a6925cc}/chrome/gdata-provider/content/browserRequest.js is in xul-ext-gdata-provider 1:52.7.0+build1-0ubuntu1.
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 | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
var wpl = Components.interfaces.nsIWebProgressListener;
var reporterListener = {
_isBusy: false,
get securityButton() {
delete this.securityButton;
return this.securityButton = document.getElementById("security-button");
},
QueryInterface: function(aIID) {
if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
aIID.equals(Components.interfaces.nsISupports))
return this;
throw Components.results.NS_NOINTERFACE;
},
onStateChange: function(/*in nsIWebProgress*/ aWebProgress,
/*in nsIRequest*/ aRequest,
/*in unsigned long*/ aStateFlags,
/*in nsresult*/ aStatus) {
},
onProgressChange: function(/*in nsIWebProgress*/ aWebProgress,
/*in nsIRequest*/ aRequest,
/*in long*/ aCurSelfProgress,
/*in long */aMaxSelfProgress,
/*in long */aCurTotalProgress,
/*in long */aMaxTotalProgress) {
},
onLocationChange: function(/*in nsIWebProgress*/ aWebProgress,
/*in nsIRequest*/ aRequest,
/*in nsIURI*/ aLocation) {
document.getElementById("headerMessage").textContent = aLocation.spec;
},
onStatusChange: function(/*in nsIWebProgress*/ aWebProgress,
/*in nsIRequest*/ aRequest,
/*in nsresult*/ aStatus,
/*in wstring*/ aMessage) {
},
onSecurityChange: function(/*in nsIWebProgress*/ aWebProgress,
/*in nsIRequest*/ aRequest,
/*in unsigned long*/ aState) {
const wpl_security_bits = wpl.STATE_IS_SECURE |
wpl.STATE_IS_BROKEN |
wpl.STATE_IS_INSECURE |
wpl.STATE_SECURE_HIGH |
wpl.STATE_SECURE_MED |
wpl.STATE_SECURE_LOW;
var browser = document.getElementById("requestFrame");
var level;
switch (aState & wpl_security_bits) {
case wpl.STATE_IS_SECURE | wpl.STATE_SECURE_HIGH:
level = "high";
break;
case wpl.STATE_IS_SECURE | wpl.STATE_SECURE_MED:
case wpl.STATE_IS_SECURE | wpl.STATE_SECURE_LOW:
level = "low";
break;
case wpl.STATE_IS_BROKEN:
level = "broken";
break;
}
if (level) {
this.securityButton.setAttribute("level", level);
this.securityButton.hidden = false;
} else {
this.securityButton.hidden = true;
this.securityButton.removeAttribute("level");
}
this.securityButton.setAttribute("tooltiptext",
browser.securityUI.tooltipText);
}
}
function cancelRequest()
{
reportUserClosed();
window.close();
}
function reportUserClosed()
{
let request = window.arguments[0].wrappedJSObject;
request.cancelled();
}
function loadRequestedUrl()
{
let request = window.arguments[0].wrappedJSObject;
document.getElementById("headerMessage").textContent = request.promptText;
let account = request.account;
if (request.iconURI != "")
document.getElementById("headerImage").src = request.iconURI;
var browser = document.getElementById("requestFrame");
browser.addProgressListener(reporterListener,
Components.interfaces.nsIWebProgress.NOTIFY_ALL);
var url = request.url;
if (url != "") {
browser.setAttribute("src", url);
document.getElementById("headerMessage").textContent = url;
}
var dialogMessage = document.getElementById("dialogMessage");
if (request.description) {
dialogMessage.textContent = request.description;
} else {
dialogMessage.setAttribute("hidden", "true");
}
request.loaded(window, browser.webProgress);
}
|