-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load custom scripts in iframe of editor in FSE and mobile review #41065
Comments
@justintadlock No, it's not the same. I don't have problem in loading files. Problem is that they are loaded on page but outside iframe. I want to suggest some hook for possibility to load something inside iframe. Allowing enqueue_block_editor_assets to work inside iframe can help, but as I understand from comments, this hook is used only for Editor panels and not supposed to work in content area of editor |
From my digging, It seems you can load <style> inside the iframe, but not <script>. In my case, I was using Ionicons 5 which requires a <script> to load font icons. The font icons wouldn't load inside a mobile preview and FSE screen since those pages get loaded through an iframe. Despite my best efforts, I could not find a way to hack it either. I had to revert to using a font file version of Ionicons to load the fonts inside the iframe. |
This appears to now be resolved - adding the note added to #47924 for details - and will close it.
|
Currently I can't find any details how to load scripts inside iframe and I see only styles there. Scripts are loaded in admin pages, but it's very common scenarios when we need also scripts inside iframe. For example, for libraries, which are detecting scroll positions. Placing such scripts outside iframe makes them inaccurate for work
The text was updated successfully, but these errors were encountered: