Closed peterhartree closed 2 years ago
Hey there and thanks for reporting!
If it doesn't work and it can't be fixed, I agree we should remove it to avoid people getting wrong expectations.
Cleaning it up would involve roughly these things:
PRs welcome? ;)
Looking into the code, with this function being broken, so does api.get.delegated_to_email()
appear as well.
That in effect also breaks/obsoletes api.get.manager_email()
, since that will now always return api.get.user_email()
.
Seems like we have a release coming with quite a few breaking changes.
Sounds like a good chance to clean out other cruft as well :smile:
Working on removing these now in the vnext-branch.
Feedback welcome.
Updated on npmjs in version 1.0.23
.
api.get.loggedin_accounts() relies on the Gmail
GLOBALS
object.Unfortunately that object no longer contains a list of logged in user accounts.
You can see this by opening the console at mail.google.com and typing
GLOBALS
. Gmail.js is expecting account information atGLOBALS[17]
, but it's just a blank array.For now, my guess is that there's no longer a good way to get a list of logged in user accounts, so this feature should be removed from Gmail.js.
Thank you for your work on this project.
Possible fixes
I've looked around the DOM a bit for ways to fix this and come up short.
For a while it was possible to read the logged in account information by using CSS selectors to get the information from the Google account switcher menu in the top right corner. However, the account switcher has now been moved into an
<iframe>
on a different domain, so it is no longer possible to access those elements.