@@ -179,6 +179,31 @@ define(function (require, exports, module) {
179179 _setupDocumentClickHandler ( ) ;
180180 }
181181
182+ let userEmail = "" ;
183+ class SecureEmail extends HTMLElement {
184+ constructor ( ) {
185+ super ( ) ;
186+ // Create closed shadow root - this is for security that extensions wont be able to read email from DOM
187+ const shadow = this . attachShadow ( { mode : 'closed' } ) ;
188+ // Create the email display with some obfuscation techniques
189+ shadow . innerHTML = `<span>${ userEmail } </span>` ;
190+ }
191+ }
192+ // Register the custom element
193+ customElements . define ( 'secure-email' , SecureEmail ) ;
194+ let userName = "" ;
195+ class SecureName extends HTMLElement {
196+ constructor ( ) {
197+ super ( ) ;
198+ // Create closed shadow root - this is for security that extensions wont be able to read name from DOM
199+ const shadow = this . attachShadow ( { mode : 'closed' } ) ;
200+ // Create the email display with some obfuscation techniques
201+ shadow . innerHTML = `<span>${ userName } </span>` ;
202+ }
203+ }
204+ // Register the custom element
205+ customElements . define ( 'secure-name' , SecureName ) ;
206+
182207 /**
183208 * Shows the user profile popup when the user is logged in
184209 */
@@ -189,12 +214,12 @@ define(function (require, exports, module) {
189214 return ;
190215 }
191216 const profileData = KernalModeTrust . loginService . getProfile ( ) ;
217+ userEmail = profileData . email ;
218+ userName = profileData . firstName + " " + profileData . lastName ;
192219 const templateData = {
193220 initials : profileData . profileIcon . initials ,
194221 avatarColor : profileData . profileIcon . color ,
195- userName : profileData . firstName + " " + profileData . lastName ,
196- email : profileData . email ,
197- planClass : "user-plan-free" ,
222+ planClass : "user-plan-free" , // "user-plan-paid" for paid plan
198223 planName : "Free Plan" ,
199224 quotaUsed : "7,000" ,
200225 quotaTotal : "10,000" ,
0 commit comments