KartikTalwar / gmail.js

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

Is it possible to monitor UI changes? #733

Open rbsam176 opened 1 year ago

rbsam176 commented 1 year ago

I've got my extension appending a DOM element when a thread is opened, but I'm trying to have it be removed when the user exits the thread view, so if they go back to the inbox it should remove the DOM element. I've seen gmail.check.is_inside_email() and gmail.get.current_page() but these don't listen for UI page changes, and if possible I'd like to avoid using gmail.observe.register() - would appreciate if someone could point me in the right direction! Thanks!

josteink commented 1 year ago

I believe the simplest way to monitor this is to check when the URL query/hash changes.

That’s what I do in my extension.