Closed Bug 190752 Opened 22 years ago Closed 20 years ago

javascript call window.close() should close the current browser tab of mozilla

Categories

(Core :: Security, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 183697

People

(Reporter: jerry.tan, Assigned: security-bugs)

References

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3b) Gecko/20030125
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3b) Gecko/20030125

<form>
<input type="button" value="OK" onclick=window.close()>
</form>

Reproducible: Always

Steps to Reproduce:
1.(ctrl+t open on tab, access the testcase
2.click the button

Actual Results:  
nothing happened

Expected Results:  
close the tab

opera support this feature,
  
and netscape 7 support this, too.
Attached file testcase
You can't close windows or tabs you did not open.  If the script opens the
window, it can close it.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
bz, I know the reason why mozilla changed its behavior.
but there are many sites using this feature,
   and it works fine with netscape 7.
and I think it is a good feature.

can it be turned on by preference setting?
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
> can it be turned on by preference setting?

Yes. pref("dom.allow_scripts_to_close_windows", true);

Jerry, I don't think any feature which allows windows with the information and
history in them to be closed is a good feature....

There is also a bug on having a confirmation dialog in such cases so the user
can decide whether to close the window -- bug 190515.  I'd call this a duplicate
of that one, if not invalid, but over to Mitch to sort out this whack-a-mole game.
Assignee: asa → mstoltz
Status: REOPENED → NEW
Component: Browser-General → Security: General
QA Contact: asa → bsharma
I'm going to call this wontfix.
Status: NEW → RESOLVED
Closed: 22 years ago21 years ago
Resolution: --- → WONTFIX
I'd call this a dup of bug 190515 (which should be wontfix IMO).  Btw,
window.close() correctly closes just one tab when called and allowed in a tabbed
window.
*** Bug 253522 has been marked as a duplicate of this bug. ***
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---

*** This bug has been marked as a duplicate of 183697 ***
Status: REOPENED → RESOLVED
Closed: 21 years ago20 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: