File tree 3 files changed +16
-2
lines changed
3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 5
5
6
6
- Drop bundled jQuery, support jQuery 4, support explicit no-jQuery mode
7
7
- Fix reply button selector to support Gmail in text labels mode
8
+ - Fix ` api.get.user_email() ` .
8
9
9
10
## Version 1.1.12
10
11
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " gmail-js" ,
3
- "version" : " 1.1.12 " ,
3
+ "version" : " 1.1.13 " ,
4
4
"description" : " JavaScript API for Gmail (useful for chrome extensions)" ,
5
5
"main" : " src/gmail.js" ,
6
6
"types" : " src/gmail.d.ts" ,
Original file line number Diff line number Diff line change @@ -115,7 +115,20 @@ var Gmail = function(localJQuery) {
115
115
116
116
117
117
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 ;
119
132
} ;
120
133
121
134
You can’t perform that action at this time.
0 commit comments