I definitely feel my attentiveness and focus dropped dramatically after computers were introduced into my work life. It's a shame that computers provide such a thin line between work and entertainment.
You can make that line thicker. You can create a new user on your computer specifically for work, with a restricted environment. You could use VMs or dualboot or something.
Personally, I'm very happy that we have devices that are capable of doing so many things.
You can but you won't as long as it is possible to bypass the trick, because you are inevitably attracted (not to say addicted) to the online web content and interactions and you'll quickly switch back to it.
This is a fair position, but we shouldn't forget that companies have poured billions of dollars into making these "tools" as addictive as possible, because that's ultimately how they make their money. See [1] and [2] for more.