gmail.js
gmail.js copied to clipboard
Fix the navigation_count function and selector
This fixes two of the methods api.helper.get.navigation_count
and api.get.storage_info
. It returns a fair amount of data back:
{storage_info:
{used: 14.32, total: 15, percent: 95},
unread_draft_emails: 152
unread_emails: {inbox: 882, drafts: 152, spam: 0, forum: 0, update: 0, …}
unread_forum_emails: 0
unread_inbox_emails: 882
unread_promotion_emails: 7
unread_social_emails: 0
unread_spam_emails: 0
unread_update_emails: 0}
I'm trying to target the aria labels and accessibility tags, as I think it's a better move to try to parse the page like https://testing-library.com/ library does testing. Looking at the page like a real user or a screen reader would, rather than targeting class names or such, which is a cat-and-mouse game.
I'm also doing console.warns when things aren't found for easier debugging. Throwing an error or console.error seemed a bit too much.
I'm totally open to any advice or feedback!