[wp-trac] [WordPress Trac] #49360: Scripts: Add polyfill for window.URL
WordPress Trac
noreply at wordpress.org
Tue Feb 4 16:45:22 UTC 2020
#49360: Scripts: Add polyfill for window.URL
---------------------------+-----------------------------
Reporter: aduth | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Script Loader | Version:
Severity: normal | Keywords:
Focuses: javascript |
---------------------------+-----------------------------
Related Gutenberg pull request:
https://github.com/WordPress/gutenberg/pull/19871
Gutenberg code planned to be included as part of the upcoming WordPress
5.4 will make use of the [https://developer.mozilla.org/en-
US/docs/Web/API/URL `URL` global constructor]. This is not supported in
Internet Explorer 11, but a polyfill exists. Following the existing
patterns of polyfills in the script loader, the accompanying patch
proposes to add the polyfill for `window.URL`. It is able to reuse the
`polyfill-library` dependency used for the `Node#contains` polyfill, so no
new dependencies are required.
Once the patch is applied, it can be verified by building the project and
visiting the Posts > New Post editor page. Viewing page source, you should
see a polyfill inline script when searching the `window.URL` key phrase.
You can further verify that when loading the editor in Internet Explorer
11, you should be able to see that `window.URL` exists using the
[https://docs.microsoft.com/en-us/previous-
versions/windows/desktop/legacy/hh968260(v%3Dvs.85) F12 Tools Console].
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49360>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list