debugging and javascript integration of battery monitor widget