Validate urls client-side

Needs Bug: 66617 to be fixed in order to be able to handle
URLs like 'http://wikimedia.org' that do not have any path
component at all.

Change-Id: I77c1493dfaf5b649989df79c0b6177b9344c2231