Working with mouseleave instead of window.onblur
Working with mouseleave instead of window.onblur

Using the calculated password requires a click on the web page's password field, which means the popup goes out of focus.  Unfortunately, using window.onblur doesn't work because the popup closes before the message it just sent to the service worker is delivered.

Instead, I'm using mouseleave on the popup's outermost div.  Leaving this div sends the message, which gets delivered in a couple of ms.  That's faster than the user can click on the password field.

I don't like this kind of race.  The alternative would be having the content script send a message to the popup to tell it to close.  The problem is that this would be the only message the popup receives.  It just doesn't seem necessary.

alanhkarp/SitePassword,alanhkarp/SitePassword