From 6237fd15b22c6b4e1a6791471c56307b5ef17e00 Mon Sep 17 00:00:00 2001 From: James Edington Date: Sat, 26 Sep 2020 20:25:07 -0500 Subject: [PATCH] Add country flag to tooltip This is mostly proof-of-concept, to show we really do have the CA -> Country mapping working usably --- src/js/util.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/js/util.js b/src/js/util.js index f5a11ea..2b710f2 100644 --- a/src/js/util.js +++ b/src/js/util.js @@ -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: @@ -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'} };