JavaScript code that is contained in one document may access aspects of the contents of another document viewed in another window, including the location, embedded links, form fields, etc. There are several restrictions on what the JavaScript program can do, however. One possible future workaround for JavaScript is that if the JavaScript code is in a document retrieved from the filesystem local to the user, then this could be considered to be safe, like the case of local Java libraries. Saving a document with embedded JavaScript to the local file system is considerably easier than installing a Java library, but perhaps it is too easy. If the JavaScript were found in a specially designated directory on the user's filesystem, then this might be sufficiently safe.
Proxies are therefore and excellent solution to the problem except for some difficulties.
First, users may not have the choice of installing a proxy, and even if they do, actually doing the installation and maintenance is extra work that seems to stop most people. If there is a proxy at all, it is probably used to get over a firewall or to do caching. And that is a second difficulty. Multiple proxies do not play well together yet. A chain of proxies is possible, but it slows down the process and compounds the complexity of dealing with different versions of the HTTP protocol, etc.