Skip to content

overrides window.onload event handlers attached using jQuery or window.addEventListener #619

@jrevillini

Description

@jrevillini

The code as written now assumes that either

  • window.onload is set explicitly, or
  • window.onload is undefined

But if someone used jQuery to add a handler i.e.
jQuery( function( $ ) { $( window ).load( function () { ... } ); } );

or they used vanilla JS i.e.
window.addEventListener( 'load', function () { ... } );

then it's going to overwrite those handlers and they'll never run.

For more info about how to attach event handlers/listeners, see https://stackoverflow.com/a/30915025/8524018

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions