Properly change URL in locationbar when it is changed by javascript

* For example on http://hastebin.com