·Don’t forget that all variable used on the client side can be hack. You shouldn't use those variable for security.
I'm not entirely sure what this thread is about, as its missing some context, but its similar to another thread I responded to earlier. The username of the currently logged in user should be available using the authenticationService service and the getCurrentUsername() method. You should be able to inject that module into your AngularJS code and retrieve the username for the extension.