Skip to content

Commit

Permalink
Add country flag to tooltip
Browse files Browse the repository at this point in the history
This is mostly proof-of-concept, to show we really do have
the CA -> Country mapping working usably
  • Loading branch information
James-E-A committed Sep 27, 2020
1 parent 3d97828 commit 6237fd1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ function getAsset(path,type=null){
}
}

function flag(s){
return String.fromCodePoint(...s.split('').map(u=>u.codePointAt()+127365));
}

function removeFragment(url){
//Removes the fragment from a URL
//TODO? iff profiler indicts this function:
Expand All @@ -148,7 +152,7 @@ function genBrowserActionSpec(secType=null,caId=null){
case secTypes.Mozilla:
return {
Icon: {path: `images/root_icons/${caId}.ico`},
Title: {title: `${caId}\n(Mozilla-trusted Root CA)`},
Title: {title: `${flag(host_country[caId]||'XX')} ${caId}\n(Mozilla-trusted Root CA)`},
BadgeText: {text: '\uD83E\uDD8A'},
BadgeBackgroundColor: {color: 'LimeGreen'}
};
Expand Down

0 comments on commit 6237fd1

Please sign in to comment.