Opened 8 years ago
Closed 3 years ago
#42163 closed defect (bug) (wontfix)
Customize: Add support for previewing requests made via the Fetch API
Reported by: |
|
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)
Note: See
TracTickets for help on using
tickets.
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
intofetch()
as well as handling ofHeaders
.