Skip to content

Commit 292ecfc

Browse files
committed
Fix statusline ssl icon is not working
From Firefox 42, gIdentityHandler methods are changed. So ssl popup was not working. Fixed this for Firefox 42 and higher, added more icons for ssl states and tooltips, and let an icon be shown in insecure pages too.
1 parent c77c31a commit 292ecfc

File tree

2 files changed

+36
-8
lines changed

2 files changed

+36
-8
lines changed

common/content/statusline.js

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,32 +214,48 @@ const StatusLine = Module("statusline", {
214214
});
215215
statusline.addField("ssl", "The currently SSL status", "liberator-status-ssl",
216216
function updateSSLState (node, state) {
217-
var className = "";
217+
var className = "notSecure";
218+
var tooltip = gNavigatorBundle.getString("identity.unknown.tooltip");
218219
if (!state) {
219220
let securityUI = config.tabbrowser.securityUI;
220221
if (securityUI)
221222
state = securityUI.state || 0;
222223
}
223224
const WPL = Components.interfaces.nsIWebProgressListener;
224-
if (state & WPL.STATE_IDENTITY_EV_TOPLEVEL)
225+
if (state & WPL.STATE_IDENTITY_EV_TOPLEVEL) {
225226
className = "verifiedIdentity";
226-
else if (state & WPL.STATE_IS_SECURE)
227+
if (state & WPL.STATE_BLOCKED_MIXED_ACTIVE_CONTENT)
228+
className = "mixedActiveBlocked";
229+
tooltip = gNavigatorBundle.getFormattedString(
230+
"identity.identified.verifier",
231+
[gIdentityHandler.getIdentityData().caOrg]);
232+
} else if (state & WPL.STATE_IS_SECURE) {
227233
className = "verifiedDomain";
228-
else if (state & WPL.STATE_IS_BROKEN) {
229-
if ((state & WPL.STATE_LOADED_MIXED_ACTIVE_CONTENT) &&
230-
options.getPref("security.mixed_content.block_active_content", false))
234+
if (state & WPL.STATE_BLOCKED_MIXED_ACTIVE_CONTENT)
235+
className = "mixedActiveBlocked";
236+
tooltip = gNavigatorBundle.getFormattedString(
237+
"identity.identified.verifier",
238+
[gIdentityHandler.getIdentityData().caOrg]);
239+
} else if (state & WPL.STATE_IS_BROKEN) {
240+
if (state & WPL.STATE_LOADED_MIXED_ACTIVE_CONTENT)
231241
className = "mixedActiveContent";
242+
else
243+
className = "mixedDisplayContent";
244+
tooltip = gNavigatorBundle.getString("identity.unknown.tooltip");
232245
}
233-
234246
node.className = className;
247+
node.setAttribute("tooltiptext", tooltip);
235248
}, {
236249
openPopup: function (anchor) {
237250
var handler = window.gIdentityHandler;
238251
if (typeof handler === "undefiend") // Thunderbird has none
239252
return;
240253

254+
if (handler.refreshIdentityPopup)
255+
handler.refreshIdentityPopup();
256+
else
257+
handler.setPopupMessages(handler._identityBox.className);
241258
handler._identityPopup.hidden = false;
242-
handler.setPopupMessages(handler._identityBox.className);
243259
handler._identityPopup.openPopup(anchor);
244260
},
245261
});

common/skin/liberator.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,18 @@
155155
visibility: visible;
156156
list-style-image: url(chrome://browser/skin/identity-mixed-active-loaded.svg);
157157
}
158+
#liberator-status-ssl.mixedDisplayContent {
159+
visibility: visible;
160+
list-style-image: url(chrome://browser/skin/identity-mixed-passive-loaded.svg);
161+
}
162+
#liberator-status-ssl.mixedActiveBlocked {
163+
visibility: visible;
164+
list-style-image: url(chrome://browser/skin/identity-mixed-active-blocked.svg);
165+
}
166+
#liberator-status-ssl.notSecure {
167+
visibility: visible;
168+
list-style-image: url(chrome://browser/skin/identity-not-secure.svg);
169+
}
158170

159171
#liberator-commandline-prompt {
160172
background-color: inherit;

0 commit comments

Comments
 (0)