Commit f4e6cbd
committed
Inline TinyMCE content_css to fix service worker gap
TinyMCE loads its content_css (editor styles, dashicons, theme
CSS) via <link> tags inside an about:blank iframe it creates for
the editing area. The Playground service worker cannot intercept
sub-resource requests from about:blank documents, so those CSS
files return 404 — visible as "Failed to load content css" in
TinyMCE's notification bar. This affects all WP versions that
use TinyMCE (3.9–4.9, and modern WP with Classic Editor) on
both localhost and 127.0.0.1 with a fresh browser context.
Add a mu-plugin that hooks tiny_mce_before_init, reads each
content_css file from disk, and passes the combined CSS inline
via TinyMCE's content_style setting. This bypasses the network
request entirely. Written in PHP 5.2-compatible syntax so it
works across all supported PHP versions.1 parent 4418547 commit f4e6cbd
1 file changed
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
822 | 822 | | |
823 | 823 | | |
824 | 824 | | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
825 | 862 | | |
826 | 863 | | |
827 | 864 | | |
| |||
0 commit comments