File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed
Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 55
66- Drop bundled jQuery, support jQuery 4, support explicit no-jQuery mode
77- Fix reply button selector to support Gmail in text labels mode
8+ - Fix ` api.get.user_email() ` .
89
910## Version 1.1.12
1011
Original file line number Diff line number Diff line change 11{
22 "name" : " gmail-js" ,
3- "version" : " 1.1.12 " ,
3+ "version" : " 1.1.13 " ,
44 "description" : " JavaScript API for Gmail (useful for chrome extensions)" ,
55 "main" : " src/gmail.js" ,
66 "types" : " src/gmail.d.ts" ,
Original file line number Diff line number Diff line change @@ -115,7 +115,20 @@ var Gmail = function(localJQuery) {
115115
116116
117117 api . get . user_email = function ( ) {
118- return api . tracker . globals [ 10 ] ;
118+ let user_email = api . tracker . globals [ 10 ] ;
119+ if ( user_email ) {
120+ return user_email ;
121+ }
122+
123+ const elements = document . getElementsByClassName ( "eYSAde" ) ;
124+ for ( const el of elements ) {
125+ if ( el . innerHTML . indexOf ( "@" ) === - 1 ) {
126+ return el . innerHTML ;
127+ }
128+ }
129+
130+ // give up
131+ return null ;
119132 } ;
120133
121134
You can’t perform that action at this time.
0 commit comments