Use explicit ports and addEventListener to avoid missing Chrome features.