use a recursive setTimeout instead of an interval for focus polling - fixes #391
Merge pull request #394 from mozilla/issue391-focus-fix

use a recursive setTimeout instead of an interval for focus polling