UI + Fetching - Be more helpful when a filter contains no text, suggest ways to deal with images in filters (#1819)

This commit is contained in:
dgtlmoon
2023-09-26 13:59:59 +02:00
committed by GitHub
parent 1e88136325
commit e30b17b8bc
4 changed files with 99 additions and 5 deletions

View File

@@ -314,7 +314,12 @@ class perform_site_check(difference_detection_processor):
# Treat pages with no renderable text content as a change? No by default
empty_pages_are_a_change = self.datastore.data['settings']['application'].get('empty_pages_are_a_change', False)
if not is_json and not empty_pages_are_a_change and len(stripped_text_from_html.strip()) == 0:
raise content_fetcher.ReplyWithContentButNoText(url=url, status_code=fetcher.get_last_status_code(), screenshot=screenshot)
raise content_fetcher.ReplyWithContentButNoText(url=url,
status_code=fetcher.get_last_status_code(),
screenshot=screenshot,
has_filters=has_filter_rule,
html_content=html_content
)
# We rely on the actual text in the html output.. many sites have random script vars etc,
# in the future we'll implement other mechanisms.