Closed
Bug 78599
Opened 24 years ago
Closed 23 years ago
Using history() methods should affect location.href??
Categories
(Core :: DOM: Navigation, defect)
Tracking
()
VERIFIED
INVALID
People
(Reporter: WeirdAl, Assigned: radha)
Details
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)
BuildID:
I've noticed that I can override the JavaScript history methods using
location.href = location.href immediately after the history method call.
Reproducible: Always
Steps to Reproduce:
1. Create the following HTML files:
<!-- 17lst01a.htm -->
<html>
<frameset cols="25%,*">
<frame name="framea" src="17lst01b.htm" />
<frame name="frameb" src="17lst01c.htm" />
</frameset>
</html>
<!-- 17lst01b.htm -->
<html>
<body>
Start page.
</body>
</html>
<!-- 17lst01c.htm -->
<html>
<body>
<a href="17lst01d.htm" target="framea">Move frame A forward</a>
</body>
</html>
<!-- 17lst01d.htm -->
<html>
<body>
<p>Forward in Frame A. <a href="17lst01e.htm"
target="frameb">Move frame B forward</a></p>
</body>
</html>
<!-- 17lst01e.htm -->
<html>
<body>
<a href="javascript:history.go(-2);location.href = location.href">
Let's move the other frame back.</a>
</body>
</html>
2. Load 17lst01a.htm.
3. Click on link in right frame to change left frame.
4. Click on link in left frame to change right frame.
5. Click on link in right frame.
Actual Results: The left frame changed (visibly). The right frame's
location.href property is used to override the history.go() method call.
Expected Results: Both frames would have gone backwards one page.
Undeniably, this is being caused by the following code:
javascript:history.go(-2);location.href = location.href
It's obvious that history.go(-2) does not change the page location by directly
setting location.href to the appropriate entry in the browser's history.
Personally, I do think this is a bug, but one which is very useful if left
unfixed. I think a better option would be to add a second argument to the
history object's methods, where a setting of true forces the method to operate
under the current arrangement.
Comment 1•23 years ago
|
||
Mozilla w2k 2001062504 does exhibits this behavior, as does IE. I suspect that
this is the desired behavior.
Comment 2•23 years ago
|
||
Using history.back() should not change the value of location.href as seen by
the page that calls history.back(). If it did, a web page could find out what
URLs you had visited previously. That would be an unnecessary privacy leak
similar to the one in bug 84749.
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → INVALID
Comment 3•22 years ago
|
||
mass-verifying Invalid bugs which haven't changed since 2001-12-31.
use the search string "PinballWizard" if you want to filter out this msg.
Status: RESOLVED → VERIFIED
Component: History: Session → Document Navigation
QA Contact: claudius → docshell
You need to log in
before you can comment on or make changes to this bug.
Description
•