Use separate security checks for focusing frames/windows

RESOLVED DUPLICATE of bug 300453

Status

()

Core
Security
RESOLVED DUPLICATE of bug 300453
16 years ago
12 years ago

People

(Reporter: Henrik Gemal, Assigned: Mitchell Stoltz (not reading bugmail))

Tracking

Trunk
Future
x86
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

16 years ago
I have a frameset ala:
<frame>
<framset src="t1.html" name="t1">
<framset src="t1.html" name="t2">
</frame>

Then in t1.html I do:
onclick=parent.t2.focus()
then I get:

Error: uncaught exception: Permission denied to call method Window.focus

t1 and t2 are on the same server...

why?

and why is it "uncaught" ?

build 20020108
It's uncaught because you did not catch it (using a try/catch).  The weird thing
is that all.js has:

pref("capability.policy.default.Window.focus", "allAccess");

So this error should not be occurring...
(Reporter)

Comment 2

16 years ago
Created attachment 64861 [details]
ZIP file with test case. contains 3 files

Comment 3

16 years ago
Gemal, have you unchecked "Allow web pages to... raise or lower windows" in
advanced prefs?  That might cause this error, since the function for focusing a
frame is the same as the function for focusing a window (!).
(Reporter)

Comment 4

16 years ago
it was the pref setting. Sorry about that.
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → WORKSFORME

Comment 5

16 years ago
Setting a pref to prevent web pages from raising/lowering windows shouldn't
break scripts that just try to focus frames.  Unfortunately, the function call
is the same for both.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Jesse, wouldn't your last comment just make this a duplicate of the "content
controls should not stop script execution" bug?

Comment 7

16 years ago
A call to focus() should succeed when it takes place within a framed document. 
In that case, it shouldn't cause Mozilla to switch windows or tabs, regardless
of the security pref.  Fixing bug 122866 would make this bug less of a problem
but wouldn't take care of it completely.
(Assignee)

Comment 8

15 years ago
Changing description to "Use separate security checks for focusing frames/windows."
Summary: trying to set focus in other frame produces "Permission denied" → Use separate security checks for focusing frames/windows
Target Milestone: --- → Future

Comment 9

15 years ago
See also bug 196922, frame.focus() should not bring window to top.
Depends on: 196922

Comment 10

12 years ago

*** This bug has been marked as a duplicate of 300453 ***
Status: REOPENED → RESOLVED
Last Resolved: 16 years ago12 years ago
No longer depends on: 196922
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.