@@ -74,6 +74,14 @@ const StatusLine = Module("statusline", {
74
74
this . _statuslineWidget = document . getElementById ( "liberator-status" ) ;
75
75
// initialize setVisibility static variables
76
76
this . setVisibility ( - 1 ) ;
77
+ // In case of insecure login forms, connection icon is updated after page load.
78
+ const VERSION = Services . appinfo . platformVersion ;
79
+ if ( services . get ( "vc" ) . compare ( VERSION , "51" ) >= 0 ) {
80
+ gBrowser . addEventListener ( "InsecureLoginFormsStateChange" ,
81
+ function ( ) {
82
+ statusline . updateField ( 'ssl' , null ) ;
83
+ } ) ;
84
+ }
77
85
} ,
78
86
79
87
/**
@@ -241,37 +249,53 @@ const StatusLine = Module("statusline", {
241
249
} ) ;
242
250
statusline . addField ( "ssl" , "The currently SSL status" , "liberator-status-ssl" ,
243
251
function updateSSLState ( node , state ) {
244
- var className = "notSecure" ;
245
- var tooltip = gNavigatorBundle . getString ( "identity.unknown.tooltip" ) ;
246
- if ( ! state ) {
247
- let securityUI = config . tabbrowser . securityUI ;
248
- if ( securityUI )
249
- state = securityUI . state || 0 ;
250
- }
251
- const WPL = Components . interfaces . nsIWebProgressListener ;
252
- if ( state & WPL . STATE_IDENTITY_EV_TOPLEVEL ) {
253
- className = "verifiedIdentity" ;
254
- if ( state & WPL . STATE_BLOCKED_MIXED_ACTIVE_CONTENT )
255
- className = "mixedActiveBlocked" ;
256
- tooltip = gNavigatorBundle . getFormattedString (
257
- "identity.identified.verifier" ,
258
- [ gIdentityHandler . getIdentityData ( ) . caOrg ] ) ;
259
- } else if ( state & WPL . STATE_IS_SECURE ) {
260
- className = "verifiedDomain" ;
261
- if ( state & WPL . STATE_BLOCKED_MIXED_ACTIVE_CONTENT )
262
- className = "mixedActiveBlocked" ;
263
- tooltip = gNavigatorBundle . getFormattedString (
264
- "identity.identified.verifier" ,
265
- [ gIdentityHandler . getIdentityData ( ) . caOrg ] ) ;
266
- } else if ( state & WPL . STATE_IS_BROKEN ) {
267
- if ( state & WPL . STATE_LOADED_MIXED_ACTIVE_CONTENT )
268
- className = "mixedActiveContent" ;
252
+ const VERSION = Services . appinfo . platformVersion ;
253
+ if ( services . get ( "vc" ) . compare ( VERSION , "51" ) >= 0 ) {
254
+ conn_icon = document . getElementById ( "connection-icon" ) ;
255
+ node . style . listStyleImage = window . getComputedStyle ( conn_icon ) . getPropertyValue ( "list-style-image" ) ;
256
+ if ( node . style . listStyleImage === "none" )
257
+ node . style . listStyleImage = "url(chrome://browser/skin/identity-icon.svg#normal)" ;
258
+
259
+ node . style . visibility = "visible" ;
260
+
261
+ var tooltip = conn_icon . tooltipText ;
262
+ if ( tooltip )
263
+ node . setAttribute ( "tooltiptext" , tooltip ) ;
269
264
else
270
- className = "mixedDisplayContent" ;
271
- tooltip = gNavigatorBundle . getString ( "identity.unknown.tooltip" ) ;
265
+ node . removeAttribute ( "tooltiptext" ) ;
266
+ } else {
267
+ var className = "notSecure" ;
268
+ var tooltip = gNavigatorBundle . getString ( "identity.unknown.tooltip" ) ;
269
+ if ( ! state ) {
270
+ let securityUI = config . tabbrowser . securityUI ;
271
+ if ( securityUI )
272
+ state = securityUI . state || 0 ;
273
+ }
274
+ const WPL = Components . interfaces . nsIWebProgressListener ;
275
+ if ( state & WPL . STATE_IDENTITY_EV_TOPLEVEL ) {
276
+ className = "verifiedIdentity" ;
277
+ if ( state & WPL . STATE_BLOCKED_MIXED_ACTIVE_CONTENT )
278
+ className = "mixedActiveBlocked" ;
279
+ tooltip = gNavigatorBundle . getFormattedString (
280
+ "identity.identified.verifier" ,
281
+ [ gIdentityHandler . getIdentityData ( ) . caOrg ] ) ;
282
+ } else if ( state & WPL . STATE_IS_SECURE ) {
283
+ className = "verifiedDomain" ;
284
+ if ( state & WPL . STATE_BLOCKED_MIXED_ACTIVE_CONTENT )
285
+ className = "mixedActiveBlocked" ;
286
+ tooltip = gNavigatorBundle . getFormattedString (
287
+ "identity.identified.verifier" ,
288
+ [ gIdentityHandler . getIdentityData ( ) . caOrg ] ) ;
289
+ } else if ( state & WPL . STATE_IS_BROKEN ) {
290
+ if ( state & WPL . STATE_LOADED_MIXED_ACTIVE_CONTENT )
291
+ className = "mixedActiveContent" ;
292
+ else
293
+ className = "mixedDisplayContent" ;
294
+ tooltip = gNavigatorBundle . getString ( "identity.unknown.tooltip" ) ;
295
+ }
296
+ node . className = className ;
297
+ node . setAttribute ( "tooltiptext" , tooltip ) ;
272
298
}
273
- node . className = className ;
274
- node . setAttribute ( "tooltiptext" , tooltip ) ;
275
299
} , {
276
300
openPopup : function ( anchor ) {
277
301
var handler = window . gIdentityHandler ;
0 commit comments