Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q104 The answer to the last question got me thinking. The actual URL of the bottom frame must be stored somewhere as a variable so that the browser can go back to the previous URL in the bottom frame. How can you get this URL?

You are here: irt.org | FAQ | JavaScript | History | Q104 [ previous next ]

It still won't work. The history object will NOT divulge the location of any of the entries. This is a security issue. Netscape and Microsoft are very keen to ensure that people can't have hidden frames or windows that sit around and monitor where people are browsing, because the danger is that that information could be sent by email or cgi to someone else.

The downside of this is that you cannot get the location of a document in another frame, where that document is from another server - unless of course you already knew the location because you placed the document in that frame.

The only way you'll get this to work is if you find a bug in the browser, in which case it'll not work on all browsers, and when revealed the bug will need to be fixed by the software vendor.

The following was pointed out to me by John Marshall:

In Navigator 4 you CAN get the href of a frame page from another domain by using:-

netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead")

before you request it with lines like:-

alert(top.frames[0].location.href)

Feedback on 'Q104 The answer to the last question got me thinking. The actual URL of the bottom frame must be stored somewhere as a variable so that the browser can go back to the previous URL in the bottom frame. How can you get this URL?'

©2018 Martin Webb