Detect mobile browser with "Desktop site" enabled

Is there a way to detect when a user on a mobile browser is using the “Desktop site” option enabled?

I need mobile users, even those forcing the browser to act as desktops, to se the mobile version of the landing page (otherwise, it’ll look bad on small screens).

Thanks!

Hey there!

In Bubble, you can use the Responsive tab to make sure mobile users see the mobile version, even if they force the desktop view.

Just go to the Responsive tab and adjust your layout to show mobile-friendly elements when the screen is small. You can hide desktop-specific elements on smaller screens and make sure your mobile version looks great.

This way, even if users are trying to force the desktop view, the mobile version will still display properly.

Hope this helps! Let me know if you need more details.

Good luck! :blush:

1 Like

Thanks for the answer! Yeah, that was the first approach, but we really needed to have 2 different versions, because things on mobile can change a lot on our landing page. Also, I’m using the old editor, so not that great for responsiveness I guess…

I’ve come up with some complex JS code to load on page load, that tries to find a “fake desktop” user, and routes the user to the mobile version. Not a perfect solution (because that mobile version will still be seen as “Desktop site” (i.e. with a zoom out effect), so yeah, can’t find a great solution.

So yeah, I guess an option would be trying to rebuild the whole landing page with a bunch of conditions… Will think about it!

Thanks a lot!

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.