Make WordPress Core

Changes between Initial Version and Version 2 of Ticket #58974


Ignore:
Timestamp:
08/03/2023 06:57:16 PM (13 months ago)
Author:
westonruter
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #58974

    • Property Owner set to westonruter
    • Property Status changed from new to accepted
  • Ticket #58974 – Description

    initial v2  
    1 In the course of making the `wp-embed` script use the `defer` loading strategy (#58931), I found that there was some old code for IE10/IE11 which we can remove now since those browsers are longer supported. Also, since they're not supported anymore we can freely make use of `URL` instead of hacking URL parsing with `document.createElement('a')`. Additionally, I noticed that the deprecated `substr()` string method is being used which should be replaced with `substring()` or `slice()`.
     1In the course of making the `wp-embed` script use the `defer` loading strategy (#58931), I found that there was some old code for IE10/IE11 which we can remove now since those browsers are longer supported. Also, since they're not supported anymore we can freely make use of `URL` instead of hacking URL parsing with `document.createElement('a')`. Lastly, the code includes a `load` event on the `window` as an apparently fallback for browsers which don't support `DOMContentLoaded`, so that event listener can be removed as well.
     2
     3Aside: I noticed that the deprecated `substr()` string method is being used which should be replaced with `substring()` or `slice()`.
    24
    35Nevertheless, as I started modernizing the `wp-embed` codebase I started running into another problem: the stipulation that `wp-embed.js` (and the generated `wp-embed.min.js`) ''not'' have any ampersands. This came up in #34698 for which r35708 notes: