@@ -43,7 +43,7 @@ window.onload = async function() {
4343 const TEST_TUPLES = [
4444 [ "ipv6.example.com" , "2001:db8::f00" , "6" , DFLAG_SSL ] ,
4545 [ "ipv4.example.com" , "192.0.2.9" , "4" , DFLAG_NOSSL ] ,
46- [ "cached.example.com" , "2001:db8::f00" , "6" , DFLAG_SSL | DFLAG_NOSSL | AFLAG_CACHE ] ,
46+ [ "cached.looooooooooooooooo000ooooooongname. example.com" , "2001:db8::f00" , "6" , DFLAG_SSL | DFLAG_NOSSL | AFLAG_CACHE ] ,
4747 ] ;
4848 pushAll ( TEST_TUPLES , "646" , REGULAR_COLOR , 0 ) ;
4949 }
@@ -231,24 +231,6 @@ function makeImg(src, title) {
231231 return img ;
232232}
233233
234- function makeSslImg ( flags ) {
235- switch ( flags & ( DFLAG_SSL | DFLAG_NOSSL ) ) {
236- case DFLAG_SSL | DFLAG_NOSSL :
237- return makeImg (
238- "gray_schrodingers_lock.png" ,
239- "Mixture of HTTPS and non-HTTPS connections." ) ;
240- case DFLAG_SSL :
241- return makeImg (
242- "gray_lock.png" ,
243- "Connection uses HTTPS.\n" +
244- "Warning: IPvFoo does not verify the integrity of encryption." ) ;
245- default :
246- return makeImg (
247- "gray_unlock.png" ,
248- "Connection does not use HTTPS." ) ;
249- }
250- }
251-
252234function makeRow ( isFirst , tuple ) {
253235 const domain = tuple [ 0 ] ;
254236 const addr = tuple [ 1 ] ;
@@ -261,12 +243,33 @@ function makeRow(isFirst, tuple) {
261243 }
262244
263245 // Build the SSL icon for the "zeroth" pseudo-column.
264- const sslImg = makeSslImg ( flags ) ;
265- sslImg . className = "sslImg" ;
246+ let sslIcon = "" ;
247+ let sslTitle = "" ;
248+ switch ( flags & ( DFLAG_SSL | DFLAG_NOSSL ) ) {
249+ case DFLAG_SSL | DFLAG_NOSSL :
250+ sslIcon = "gray_schrodingers_lock.png" ;
251+ sslTitle = "Mixture of HTTPS and non-HTTPS connections." ;
252+ break ;
253+ case DFLAG_SSL :
254+ sslIcon = "gray_lock.png" ;
255+ sslTitle = "Connection uses HTTPS.\nWarning: IPvFoo does not verify the integrity of encryption." ;
256+ break ;
257+ default :
258+ sslIcon = "gray_unlock.png" ;
259+ sslTitle = "Connection does not use HTTPS." ;
260+ break ;
261+ }
266262
267263 // Build the "Domain" column.
268264 const domainTd = document . createElement ( "td" ) ;
269- domainTd . appendChild ( sslImg ) ;
265+ domainTd . style . setProperty ( "--ssl-icon" , `url("${ sslIcon } ")` ) ;
266+
267+ // Tooltip for the "zeroth" column.
268+ const sslTooltip = document . createElement ( "span" ) ;
269+ sslTooltip . className = "sslTooltip" ;
270+ sslTooltip . title = sslTitle ;
271+ domainTd . appendChild ( sslTooltip ) ;
272+
270273 if ( domain . length > LONG_DOMAIN ) {
271274 domainTd . appendChild ( makeSnippedText ( domain , Math . floor ( LONG_DOMAIN / 2 ) ) ) ;
272275 } else {
0 commit comments