# Persisting desktop/mobile view in mobile Chrome browsers

**URL:** https://meta.discourse.org/t/persisting-desktop-mobile-view-in-mobile-chrome-browsers/41326
**Category:** UX
**Created:** [March 20, 2016, 7:01am UTC](https://meta.discourse.org/t/persisting-desktop-mobile-view-in-mobile-chrome-browsers/41326 "2016-03-20T07:01:57Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [March 20, 2016, 7:01am UTC](https://meta.discourse.org/t/persisting-desktop-mobile-view-in-mobile-chrome-browsers/41326/1 "2016-03-20T07:01:57Z")

</div>

I have both an Android phone & tablet, running the latest releases of Android/Chrome.

On the Pixel C, my standard orientation is landscape with a keyboard, so the mobile UI is not ideal. I keep trying the “request desktop version” in the browser options, but **really** wish that I didn’t have to do this step every single time I load a Discourse site.

Is there any way to persist the mobile/desktop preferences based on a cookie or something?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [March 20, 2016, 8:56am UTC](https://meta.discourse.org/t/persisting-desktop-mobile-view-in-mobile-chrome-browsers/41326/2 "2016-03-20T08:56:20Z")

</div>

Yes, but that cookie would be per domain so how would it help? The real issue is, freakishly rare android tablet, does it send a unique agent like the Nexus series do?

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [March 22, 2016, 6:35am UTC](https://meta.discourse.org/t/persisting-desktop-mobile-view-in-mobile-chrome-browsers/41326/3 "2016-03-22T06:35:01Z")

</div>

> [@codinghorror](#):
>
> Yes, but that cookie would be per domain so how would it help?

I guess it would help by keeping the desktop UI setting every time I went to [mydiscoursesite.example.org](http://mydiscoursesite.example.org) in my Android Chrome browser. Isn’t that desirable?

And, yes, unique user agent indeed:

> Mozilla/5.0 (Linux; Android 6.0.1; Pixel C Build/MXC14G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.91 Safari/537.36

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 22, 2016, 6:39am UTC](https://meta.discourse.org/t/persisting-desktop-mobile-view-in-mobile-chrome-browsers/41326/4 "2016-03-22T06:39:25Z")

</div>

I think the call here is to always ask for `Mobile + Android` for Android mobile detection, if we need to whitelist some more 7’’ tablets (so they are treated as mobile) then we can

---

<div class="post-metadata">

### Author: ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)
#### Post date: [March 24, 2016, 11:30pm UTC](https://meta.discourse.org/t/persisting-desktop-mobile-view-in-mobile-chrome-browsers/41326/5 "2016-03-24T23:30:07Z")

</div>

There are some specific Google Chrome user agent detection recommendations for “Phone” vs “Tablet” listed here:

[https://developer.chrome.com/multidevice/user-agent](https://developer.chrome.com/multidevice/user-agent)

- Phone pattern: `Android` + `Chrome/[.0-9]* Mobile`
- Tablet pattern: `Android` + `Chrome/[.0-9]* (?!Mobile)`

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [March 26, 2016, 9:01am UTC](https://meta.discourse.org/t/persisting-desktop-mobile-view-in-mobile-chrome-browsers/41326/6 "2016-03-26T09:01:35Z")

</div>

All right, I’m changing it to

```plaintext
user_agent =~ /Mobile/ && !(user_agent =~ /iPad/)

```

No idea why we had webOS in there, who even uses that? Let’s just say it’s a mobile device if it is telling us it is one:

`Mobile`

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [March 28, 2016, 9:03am UTC](https://meta.discourse.org/t/persisting-desktop-mobile-view-in-mobile-chrome-browsers/41326/7 "2016-03-28T09:03:10Z")

</div>

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