I have made this work using the visibilitychange
event as described here:
http://docs.appgyver.com/en/edge/steroids_Steroids%20Native%20UI_events_events.visibilitychange.md.html
The final correct code to get this to work was:
document.addEventListener("visibilitychange", getFavs, false);
Placing this inside the JS file of the tab worked perfectly.