Bug 19468 - Unable to dispatch Window load and unload events
Summary: Unable to dispatch Window load and unload events
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 525.x (Safari 3.1)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL: http://weston.ruter.net/projects/test...
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-10 14:03 PDT by Weston Ruter
Modified: 2022-08-10 10:03 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Weston Ruter 2008-06-10 14:03:47 PDT
Both Firefox 2/3 and Opera 9.26 are able to dispatch load and unload events on the Window. In Safari 3.1.1, however, there exists no function window.dispatchEvent(). I attempted a workaround by creating and initializing load and unload events which bubble (they are specified not to bubble) and then dispatching these on the documentElement with the hope that they would bubble up to the Window, and this does work, but only for unload events. In Safari there is no way to fire Window load events unless the traditional event model is employed and window.onload() is envoked. It would seem that Safari's behavior should be brought into line with Firefox and Opera's.

See associated URL for examples.
Comment 1 Ahmad Saleem 2022-08-10 10:02:57 PDT
I am unable to reproduce this bug by using website in the URL and changed to following JSFiddle:

Link - https://jsfiddle.net/k7ajdp2z/show

*** Safari 15.6 on macOS 12.5 ***

1) Website load and green splash to indicate onload event

2) Clicking - Fire load event on window - Green splash

3) Clicking - Fire unload event on window - Red splash

4) Clicking - Fire bubbling load event on documentElement - Nothing and nothing in Console

5) Clicking - Fire bubbling unload event on documentElement - Red Splash

*** Chrome Canary 106 ***

Same as Safari 15.6

*** Firefox Nightly 105 ***

Same as Safari 15.6 and Chrome Canary 106

____________-

Since all browsers are working fine, I am going to mark this as RESOLVED CONFIGURATION CHANGED but in case if there is something still need to be done, please reopen. Thanks!
Comment 2 Ahmad Saleem 2022-08-10 10:03:04 PDT
I am unable to reproduce this bug by using website in the URL and changed to following JSFiddle:

Link - https://jsfiddle.net/k7ajdp2z/show

*** Safari 15.6 on macOS 12.5 ***

1) Website load and green splash to indicate onload event

2) Clicking - Fire load event on window - Green splash

3) Clicking - Fire unload event on window - Red splash

4) Clicking - Fire bubbling load event on documentElement - Nothing and nothing in Console

5) Clicking - Fire bubbling unload event on documentElement - Red Splash

*** Chrome Canary 106 ***

Same as Safari 15.6

*** Firefox Nightly 105 ***

Same as Safari 15.6 and Chrome Canary 106

____________-

Since all browsers are working fine, I am going to mark this as RESOLVED CONFIGURATION CHANGED but in case if there is something still need to be done, please reopen. Thanks!