Fix #309: Autofocus prevention is broken

Autofocus was broken by some Firefox update, possibly version 29. This
commit fixes it again. It also fixes a bug where autofocus was prevented
even on blacklisted sites, and cleans the code a bit.
Remove stray `console.log`s
Merge pull request #322 from lydell/fix-autofocus

Fix autofocus