Make WordPress Core

Opened 7 years ago

Closed 22 months ago

#42163 closed defect (bug) (wontfix)

Customize: Add support for previewing requests made via the Fetch API

Reported by: westonruter's profile westonruter Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.7
Component: Customize Keywords: has-patch needs-testing
Focuses: javascript Cc:

Description

The Customizer preview supports applying the customized state to Ajax requests via jQuery.prefilterAjax. However, if a frontend is not using jQuery but rather the Fetch API then the customized state will not be injected into the request in order to have the customized state applied to the response. In the same way that customize-preview.js is wrapping history.replaceState() and history.pushState() to inject the customized state, we should also wrap fetch() to do the same. We may also want to do this for XMLHttpRequest as well.

Change History (5)

#1 @westonruter
7 years ago

  • Keywords has-patch needs-testing added
  • Version set to 4.7

Feature plugin for testing: https://github.com/xwp/wp-customize-preview-fetch-api

Pull requests welcome. There are some outstanding todos for supporting the passing of Request into fetch() as well as handling of Headers.

#2 @johnbillion
7 years ago

  • Milestone changed from 4.9.1 to 5.0

#3 @johnbillion
6 years ago

  • Milestone changed from 5.0 to 5.1

#4 @pento
5 years ago

  • Milestone changed from 5.1 to Future Release

#5 @westonruter
22 months ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

New feature development is being directed toward the Site Editor, so I'm closing this.

Note: See TracTickets for help on using tickets.