Email-Intelligence icon indicating copy to clipboard operation
Email-Intelligence copied to clipboard

Add compatibility for new Gmail redesign

Open scottberke opened this issue 6 years ago • 4 comments

Gmail redesign caused issues with pulling the email ID and subsequently accessing the raw email source. Location slug no longer corresponds to the email ID. The email ID or thread ID seems to be accessed by a number of other plugins from the h2[data-legacy-thread-id] element so this update pulls from that element as it's present in both new and classic Gmail.

ServiceLink is also now inserted as an adjacent element to the span as the new redesign was repainting that element after the service link was being added.

scottberke avatar Jun 27 '18 16:06 scottberke

This is awesome. I'll merge it this week! Thank you!

nquinlan avatar Jul 02 '18 13:07 nquinlan

@nquinlan Awesome! Let me know if there are any issues or updates you want me to make to the PR.

scottberke avatar Jul 03 '18 16:07 scottberke

@scottberke I had an opportunity to review this, however it looks like this may introduce a race condition where window.onpopstate is triggered before h2[data-legacy-thread-id] is updated, thus causing the plugin to be behind by one email if you're scrolling through emails using j/kor the arrow keys. Reproduced in both Gmail Classic and New. Can you fix the race condition?

nquinlan avatar Jul 14 '18 19:07 nquinlan

@nquinlan Been on vacation for the last week. I'll look at this sometime this week and update. Thanks for the feedback!

scottberke avatar Jul 23 '18 18:07 scottberke