Fix detection classes to support workers (no head, body document etc)