- Issue created by @GaëlG
- 🇨🇴Colombia andresalvarez Bogota
Hi gaëlg,
Thank you for reaching out and for your kind words about the contribution!
I appreciate you pointing out the existing Iframe Lazy Loading module. After reviewing both implementations, I can explain the key differences between our approaches:
Technical Differences:Implementation Strategy: Your module uses DOM manipulation with Html::load() and Html::serialize(), while mine uses regex-based pattern matching with preg_replace(). This makes my implementation lighter and potentially faster for large content blocks.
Scope Coverage: My module implements a broader approach by using hook_element_info_alter() to process all render elements at the system level, plus field preprocessing. Your module focuses specifically on text filters and iframe-specific hooks.
Performance Considerations: Your module processes the entire DOM tree for each filtered text, while mine uses targeted regex patterns that only process content containing iframes.
Hook Coverage: Your module excellently handles specific use cases like the iframe module and video_embed_field module through targeted preprocess hooks. Mine takes a more universal approach that should catch iframes from any source.
Complementary Approaches:
Both modules solve the same problem but with different philosophies - yours is more targeted and precise, while mine aims for broader coverage with lighter processing. Depending on the site's needs, users might prefer one approach over the other.
I'll update the project page to clearly explain these differences so users can make an informed choice based on their specific requirements.
Thanks again for the feedback and for maintaining such a solid alternative!