RESOLVED FIXED281212
Disable iPad Mini UA overrides when Site Specific Hacks are disabled
https://bugs.webkit.org/show_bug.cgi?id=281212
Summary Disable iPad Mini UA overrides when Site Specific Hacks are disabled
Karl Dubost
Reported 2024-10-10 02:17:32 PDT
This is a followup on bug 269335
Attachments
Karl Dubost
Comment 1 2024-10-10 02:18:09 PDT
Karl Dubost
Comment 2 2024-10-10 02:27:16 PDT
Currently some sites have an iPad Mini UA override, when their desktop site is not compatible with the iPad (often because of touch events) As of now, it is not possible for someone to test the site without the UA override by disabling the Site Specific Hacks in Web Inspector. https://github.com/WebKit/WebKit/blob/e5129b67d050188136b89e6666472ca59339256e/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm#L1405-L1412 There is no check for the Quirks preference. ``` enum class RecommendDesktopClassBrowsingForRequest { No, Yes, Auto }; static RecommendDesktopClassBrowsingForRequest desktopClassBrowsingRecommendedForRequest(const WebCore::ResourceRequest& request) { // FIXME: This should be additionally gated on site-specific quirks being enabled. // See also: <rdar://problem/50035167>. // The list of domain names is currently available in Source/WebCore/page/Quirks.cpp if (Quirks::needsIPadMiniUserAgent(request.url())) return RecommendDesktopClassBrowsingForRequest::No; // content cut for brevity … } ``` The method is static and does not have access to document. but this is called by ``` bool WebPageProxy::isDesktopClassBrowsingRecommended(const WebCore::ResourceRequest& request) const { auto desktopClassBrowsingRecommendation = desktopClassBrowsingRecommendedForRequest(request); if (desktopClassBrowsingRecommendation == RecommendDesktopClassBrowsingForRequest::Yes) return true; if (desktopClassBrowsingRecommendation == RecommendDesktopClassBrowsingForRequest::No) return false; // content cut for brevity … } ``` which is itself called by ``` bool WebPageProxy::useDesktopClassBrowsing(const API::WebsitePolicies& policies, const WebCore::ResourceRequest& request) const { switch (policies.preferredContentMode()) { case WebContentMode::Recommended: { return isDesktopClassBrowsingRecommended(request); } // content cut for brevity … } ``` that should make it possible to access the settings if (m_frame->settings().needsSiteSpecificQuirks()) { }
Karl Dubost
Comment 3 2024-10-11 08:21:59 PDT
Brent Fulgham
Comment 4 2024-10-11 17:05:58 PDT
EWS
Comment 5 2024-10-14 19:04:08 PDT
Committed 285166@main (d146f360321a): <https://commits.webkit.org/285166@main> Reviewed commits have been landed. Closing PR #35081 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.