Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#38585 closed defect (bug) (fixed)

Exit `wp-custom-header.js` gracefully in browsers without `addEventListener` support.

Reported by: peterwilsoncc Owned by: peterwilsoncc
Priority: normal Milestone: 4.7
Component: Themes Version: 4.7
Severity: normal Keywords: has-patch
Cc: Focuses: javascript

Description

wp-custom-header.js throws an error in browsers that don't support document.addEventListener.

Add a check for browser support and fail gracefully if it doesn't pass.

Attachments (1)

38585.diff​ (439 bytes ) - added by peterwilsoncc 10 years ago.

Download all attachments as: .zip

Change History (3)

#1 @peterwilsoncc
10 years ago

  • Keywords has-patch added
  • Version → trunk

38585.diff​ adds required check.

#2 @peterwilsoncc
10 years ago

  • Owner set to peterwilsoncc
  • Resolution → fixed
  • Status new → closed

In 39050:

Themes: Exit wp-custom-header.js early in browsers wihout modern events.

Adds a check for window.addEventListener support before attempting to use it. In browsers without support, the file is exited early to avoid throwing a JavaScript error.

Fixes #38585.

Note: See TracTickets for help on using tickets.