gmail.js icon indicating copy to clipboard operation
gmail.js copied to clipboard

Add observe on event for Gmail tab switch

Open mcmxcdev opened this issue 4 years ago • 3 comments

I would need to know when the user switches tab (Primary, Social, Promotions, etc.) to be able to update the UI with certain elements. Is there a method like that available or any known workarounds?

view_thread observer seems to update whenever opening another email, so the same functionality would be great.

mcmxcdev avatar Jan 12 '22 17:01 mcmxcdev

None that I know about. PRs welcome though 🙂

josteink avatar Jan 12 '22 17:01 josteink

Just a small workaround I use:

You can add an observer for http_event and check for params.url.act === "oestp". From what I've seen it's called when the tabs switch, don't know if it's really related.

DrParanoia avatar Apr 21 '22 17:04 DrParanoia

Thank you for the suggestion! It's a while ago but I think I solved it by checking the aria-selected attribute of the tabs

mcmxcdev avatar Apr 22 '22 05:04 mcmxcdev