JS Error: focusedWindow.location has no properties

RESOLVED WORKSFORME

Status

()

Core
XUL
RESOLVED WORKSFORME
17 years ago
4 years ago

People

(Reporter: aogun, Assigned: Dan M)

Tracking

({dom0})

Trunk
Future
x86
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

17 years ago
Here we have a frameset, and one frame has a button which, when clicked, 
replaces the location of that frame with yahoo.com.

The frame replaces OK, but on both Netscape 6 and the latest Mozilla milestone, 
an error pops up in the JavaScript console: "focusedWindow.location has no 
properties"

This consists of 3 files in the same folder  . View File 1, then click to 
produce the bug.

----------------- File 1: ns6frameset.html ----------------
<html>
<head>
</head>
<frameset name="mainframeset" cols="50%,50%">
	<frame name="nothingframe" src="detail.html" scrolling="auto">
	<frameset name="rightframeset" id="rightframeset" rows="77%,*">';
		<frame name="top" src="ns6test.html" scrolling="auto">
		<frame name="DCS" src="detail.html" scrolling="auto">
	</frameset>
</frameset>
</html>

----------------------- File 2: detail.html ----------------------
<html>
</html>

----------------- File 3: ns6test.html -------------------
<HTML>
<HEAD>
<SCRIPT>
function mouseClick()
{
	window.location.replace("http://www.yahoo.com")
}
</SCRIPT>
</HEAD>
<BODY>
<A href="javascript:mouseClick()">Click to cause bug</A>
</BODY>
</HTML>

Comment 1

17 years ago
over to DOM
Assignee: asa → jst
Status: UNCONFIRMED → NEW
Component: Browser-General → DOM Level 0
Ever confirmed: true
QA Contact: doronr → desale
Summary: Exception thrown when frame location is replaced in handler → Exception thrown when frame location is replaced in handler
Keywords: dom0
The exception you see is from the mozilla application code, it's not something
that happens because of something you did on the page, reassigning to XPToolkit.
Assignee: jst → trudelle
Component: DOM Level 0 → XP Toolkit/Widgets
QA Contact: desale → jrgm

Comment 3

17 years ago
why toolkit?  ->danm for triage since it is a window call, cc saari for possible
focus involvement
Assignee: trudelle → danm

Comment 4

17 years ago
->future
Summary: Exception thrown when frame location is replaced in handler → JS Error: focusedWindow.location has no properties
Target Milestone: --- → Future

Comment 5

17 years ago
The error is coming in function contentAreaFrameFocus in navigator.js,
said function being set up as a capturing focus event listener on the
'appcontent' element.


// When a content area frame is focused, update the focused frame URL
function contentAreaFrameFocus()
{
  var focusedWindow = document.commandDispatcher.focusedWindow;
  if (isDocumentFrame(focusedWindow)) {
      gFocusedURL = focusedWindow.location.href;
      var saveFrameItem = document.getElementById("savepage");
      saveFrameItem.removeAttribute("hidden");
  }
}

If you load any page with a frameset, and then do a right click, and reload a
frame, you will get this error. Any attempt to refer to the location property
of the window will fail. (Maybe it "doesn't have" a location at that point in
the reload???). Offhand, wrapping that block in a try has no ill effects, since
there are more focus events that follow, which do succeed in updating the UI.

Blake, Jag : is this a known problem? (I think it is ...)

Comment 6

17 years ago
See also bug 65963, which reports a similar error in the JS console and also
involves frames.

Comment 7

17 years ago
Either this bug should be a dup of bug 65963 or vice versa.

Comment 8

16 years ago
*** Bug 65963 has been marked as a duplicate of this bug. ***

Comment 9

16 years ago
works for me
20020117
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.