Can a webpage open in Safari crash the whole computer? I have a Mid-2011 MacBook Air. Everything seems to be working fine, except Safari keeps freezing and stops responding. Sometimes, when Safari freezes, it causes the whole computer to crash and I have to restart it.

I thought browsers were supposed to have security measures that prevent this from happening (like Sandboxing). How can a webpage crash the whole OS?
My assumption solution:
Safari is continuously attempting to reload the last session.
To resolve this issue go to ~/Library/Saved Application State/
Remove the com.safari... folder and place in the Trash.

A second issue could be adware, which created the issue in the first place. 
Open Safari, which should operate properly after removing the above folder, and go to AdwareMedic .
Download and run the free program and that will remove any adware.