You should call it from spark.dart (on the window focus event).