Add observe on event for Gmail tab switch
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.
None that I know about. PRs welcome though 🙂
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.
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