<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>281212</bug_id>
          
          <creation_ts>2024-10-10 02:17:32 -0700</creation_ts>
          <short_desc>Disable iPad Mini UA overrides when Site Specific Hacks are disabled</short_desc>
          <delta_ts>2024-10-14 19:04:10 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit Misc.</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>269335</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Karl Dubost">karlcow</reporter>
          <assigned_to name="Brent Fulgham">bfulgham</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2066842</commentid>
    <comment_count>0</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2024-10-10 02:17:32 -0700</bug_when>
    <thetext>This is a followup on bug 269335</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2066843</commentid>
    <comment_count>1</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2024-10-10 02:18:09 -0700</bug_when>
    <thetext>rdar://50035167</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2066844</commentid>
    <comment_count>2</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2024-10-10 02:27:16 -0700</bug_when>
    <thetext>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&amp; request)
{
    // FIXME: This should be additionally gated on site-specific quirks being enabled.
    // See also: &lt;rdar://problem/50035167&gt;.
    // 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&amp; 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&amp; policies, const WebCore::ResourceRequest&amp; 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-&gt;settings().needsSiteSpecificQuirks()) { }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2067225</commentid>
    <comment_count>3</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2024-10-11 08:21:59 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/35044</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2067393</commentid>
    <comment_count>4</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2024-10-11 17:05:58 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/35081</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2067924</commentid>
    <comment_count>5</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-10-14 19:04:08 -0700</bug_when>
    <thetext>Committed 285166@main (d146f360321a): &lt;https://commits.webkit.org/285166@main&gt;

Reviewed commits have been landed. Closing PR #35081 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>