FIX: include crawler content on old mobile browsers (#16387)

Previous to this change an optimisation stripped crawler content from
all mobile browsers.

This had a side effect that meant that when we dropped support for an old
mobile platform we would stop rendering topic and topic list pages.

The new implementation ensures we only perform the optimisation on modern
mobile browsers.
This commit is contained in:
Sam
2022-04-06 20:09:12 +10:00
committed by GitHub
parent 357011eb3b
commit 254f48e568
4 changed files with 83 additions and 1 deletions

View File

@ -393,7 +393,11 @@ module ApplicationHelper
end
def include_crawler_content?
crawler_layout? || !mobile_view?
crawler_layout? || !mobile_view? || !modern_mobile_device?
end
def modern_mobile_device?
MobileDetection.modern_mobile_device?(request.user_agent)
end
def mobile_device?