Hidden Extension to Refresh Itself
===

I have a notification extension that shows number of new notifications on itself.

How can i make my extension refresh itself in XX seconds when it is not shown so it can update its number? 

I've tried this page: http://stackoverflow.com/questions/8705200/chrome-extension-refresh-page-when-is-not-visible
But it only works when it is visible (in that case, in else statement) I can't get it work when it is hidden. How is this possible?