There are legitimate reasons for port scanning, but I'm not sure most websites out there are using it for noble purposes.
I guess browsers could allow it based on explicit permission from the user, just like it's already done for microphone and camera.