fix: remove_overlay_elements can remove body if it has a global popup… - #2163
fix: remove_overlay_elements can remove body if it has a global popup…#2163Nalhin wants to merge 3 commits into
Conversation
Removed unnecessary wait for animations before scrolling.
|
Thanks for finding the issue and raising the PR! Tested this locally against
Dumped the live DOM to find the culprit - it's a different element: { "tag": "DIV", "cls": "wrapper", "pos": "relative", "z": "1000", "textlen": 1962 }The entire page sits inside Two ways to go, your call:
|
|
Hey, @SohamKukreti these look a bit like distinct issues to me. I think it makes sense to land this PR and address the z-index 1000 + position: relative issue in a follow up PR. WDYT? |
|
Hey @Nalhin, sure, that makes sense. Let’s go with a follow up PR for this. Thanks for taking the time to work on it! |
Summary
Fixing: #2161 (created by me).
Issue summary:
remove_overlay_elements can remove body (leaving empty page) when class name contains "popup".
This can happen for some popular wp themes e.g. https://themeforest.net/item/bridge-creative-multipurpose-wordpress-theme/7315054 with class .qode_popup_menu_push_text_right (more details here: https://www.google.com/search?q=qode_popup_menu_push_text_right).
List of files changed and why
crawl4ai/js_snippet/remove_overlay_elements.js - preventing html/body/head from being removed.
tests/test_issue_2161_overlay_html_body.py - tests targeting the specific issue
How Has This Been Tested?
Added unit tests. Tested on examples in the issue.
Checklist: