Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    isc.Browser.isTablet on Android

    SmartClient Version: v13.0p_2024-05-20/AllModules Development Only (built 2024-05-20)

    Hello, while trying the showcase with this two physical devices:

    - iPad Pro physical device, 11" 2nd generation, iPadOS 17.4.1
    - Samsung Galaxy Tab A, Android 10 One UI 2.1

    i noticed that, when requesting the desktop version, on the iPad isc.Browser.isTablet is true, while on the Samsung is false.

    is it expected?

    #2
    When you say, "requesting the desktop version," do you mean having the browser on your tablet make a request for the desktop website?

    When you do this, the browser will use a modified userAgent string designed to look like that of a desktop browser. So the results that you report are that this works for Samsung (since Browser.isTable is false), but not for the IPad.

    This is actually as expected, because since iOS 13, Safari by default uses the desktop userAgent on tablets. To deal with this, the framework JS sets an override flag if touch points are available on Safari that then forces isIPad:true and isIPhone:true even for the desktop userAgent, causing isTablet to be set true on that platform. We do this, because otherwise we can't get proper layout for iOS devices. The side-effect of this, though, is that there's no way on iOS to actually get desktop layout using just the browser UI.

    In cases like this, the devices are basically trying to lie to us, even as they have many issues that we need to work around, so this ends up being a kind of struggle where they try ever harder to impersonate other devices or software, even though they cannot actually render content that those other devices/software can render, and do best with.

    In this specific case, you can set window.isc_ignoreMobileSafariDesktopMode:false to disable the SC framework override flag but then you'll get the desktop site by default on your IPad, and you'll have to use "request mobile website" to get the expected (tablet) layout.

    Comment

    Working...
    X