CloakBrowser icon indicating copy to clipboard operation
CloakBrowser copied to clipboard

Question / Feature request - Mobile browser "emulation"

Open dyanakiev opened this issue 8 months ago • 8 comments

Is it possible to make launch_persistent_context behave like a mobile browser?

I consulted with AI, and it suggested passing the following options, but I believe not all of them are supported. Could you provide a solution or a suitable alternative to this?

   "viewport": {"width": 390, "height": 844},
   "device_scale_factor": 3,
   "is_mobile": True,
   "has_touch": True,
   "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1",

dyanakiev avatar Mar 14 '26 16:03 dyanakiev

All of those options work today. Pass them directly as kwargs:

from cloakbrowser import launch_persistent_context

context = launch_persistent_context(
    "/tmp/mobile-profile",
    viewport={"width": 390, "height": 844},
    device_scale_factor=3,
    is_mobile=True,
    has_touch=True,
    user_agent="Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1",
)

viewport and user_agent are named parameters. is_mobile, has_touch, and device_scale_factor pass through via **kwargs to Playwright's launch_persistent_context() which accepts them natively.

Same works with launch_context() and async variants.

One caveat: the binary's fingerprint engine currently only supports desktop platform profiles. Some low-level browser APIs may still return desktop signals, which could look inconsistent alongside a mobile user agent. For basic mobile viewport/touch emulation this works fine.

Is this sufficient for your use case, or would you also need full mobile fingerprint consistency at the binary level? If so we can track that as a feature request.

Cloak-HQ avatar Mar 14 '26 17:03 Cloak-HQ

Thanks @Cloak-HQ, this is currently sufficient for my use case. However, having full mobile fingerprint consistency at the binary level might be beneficial to others or even to me in the future.

dyanakiev avatar Mar 14 '26 17:03 dyanakiev

Good to hear! We'll track mobile fingerprint consistency as a feature request. Think --fingerprint-platform=android / ios — so the full fingerprint stack (screen metrics, platform APIs, touch capabilities, GPU signatures) all report mobile-native values consistently. No more mismatches between your UA and what the browser exposes under the hood.

If anyone else needs this, thumbs-up this issue so we can prioritize.

Cloak-HQ avatar Mar 14 '26 17:03 Cloak-HQ

yeah,that will be amazing

evelaa123 avatar Mar 14 '26 22:03 evelaa123

Good to hear! We'll track mobile fingerprint consistency as a feature request. Think --fingerprint-platform=android / ios — so the full fingerprint stack (screen metrics, platform APIs, touch capabilities, GPU signatures) all report mobile-native values consistently. No more mismatches between your UA and what the browser exposes under the hood.

If anyone else needs this, thumbs-up this issue so we can prioritize.

This is exactly what the community needs. Full mobile fingerprint consistency will take CloakBrowser to the next level. Really hyped for the Android/iOS support!

Zulwatha avatar Mar 15 '26 19:03 Zulwatha

Mobile platform fingerprinting is on our roadmap. We've done an initial audit and the scope is significant. The current patch set is desktop-only across the board. Screen dimensions, GPU renderer strings, platform API returns, and touch surface reporting all assume desktop. A proper mobile implementation needs consistent mobile-native values across all of these, new platform profiles for Android and iOS, passing every detection system that desktop already clears plus mobile-specific ones, and maintaining it all across Chromium version bumps.

Features like this get prioritized based on community support. If this matters to your workflow, consider sponsoring the project to help us get there faster.

Cloak-HQ avatar Mar 15 '26 20:03 Cloak-HQ

hello, any update?

itmanvn avatar May 10 '26 06:05 itmanvn

Hi guys, what's a progress and ETA for that features ? is it on roadmap ?

PanchenkoYehor avatar Aug 11 '26 09:08 PanchenkoYehor