KartikTalwar / gmail.js

Gmail JavaScript API
MIT License
3.74k stars 455 forks source link

How to detect when user switches between compose windows? #737

Open markon1 opened 1 year ago

markon1 commented 1 year ago

compose event is triggered only when compose is started, not when user switches between multiple open composes. How can I detect this and get the compose object of active compose?

josteink commented 1 year ago

There’s no API for that. But if you structure your code correctly, it should be able to work around for many scenarios.

What are you actually trying to accomplish?

markon1 commented 1 year ago

I just need to change display in my chrome extension each time user switches between compose windows, based on some properties of compose object.

josteink commented 1 year ago

Then you will have to access the main compose html-element exposed by the compose instance and add your own custom DOM events on to that.

josteink commented 1 year ago

And if you can find a fairly generic way to do that… feel free to submit a PR 😉