Closed Bug 261998 Opened 20 years ago Closed 20 years ago

onbeforeunload should not apply to internal anchors

Categories

(Core :: DOM: Events, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: mikecaines, Assigned: jst)

Details

(Keywords: fixed-aviary1.0, fixed1.7.5)

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20040913 Firefox/0.10
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20040913 Firefox/0.10

If an assigned onbeforeunload event handler 'cancels' the event, clicking on an
anchor which has an href referencing an element id, results in the dialog which
asks the user to confirm navigating away from the page. IEWin does not exhibit
this behaviour.

Reproducible: Always
Steps to Reproduce:
1. See testcase
2. Click the 'go to foo' link.

Actual Results:  
Confirm dialog is shown.

Expected Results:  
Confirm dialog is not shown.
Attached file Testcase
also seen on linux, current cvs (trunk)
OS: Windows XP → All
Attached patch Fix.Splinter Review
Assignee: events → jst
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #160426 - Flags: superreview?(bzbarsky)
Attachment #160426 - Flags: review?(bzbarsky)
Comment on attachment 160426 [details] [diff] [review]
Fix.

r+sr=bzbarsky
Attachment #160426 - Flags: superreview?(bzbarsky)
Attachment #160426 - Flags: superreview+
Attachment #160426 - Flags: review?(bzbarsky)
Attachment #160426 - Flags: review+
Fix checked in on the trunk.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Comment on attachment 160426 [details] [diff] [review]
Fix.

Low-hanging fruit that's probably worth taking on the branches as
onbeforeunload events will get more popular as developers discover them.
Attachment #160426 - Flags: approval1.7.x?
Attachment #160426 - Flags: approval-aviary?
Comment on attachment 160426 [details] [diff] [review]
Fix.

a=asa for branches checkin.
Attachment #160426 - Flags: approval1.7.x?
Attachment #160426 - Flags: approval1.7.x+
Attachment #160426 - Flags: approval-aviary?
Attachment #160426 - Flags: approval-aviary+
Fixed on branches.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: