Can't log in on Android Chrome


Hi, new user here, hope you can help.

I’ve just installed Discourse and have it running behind a proxy with NGINX after following the guide here…

No problems at all with it on Chrome or Firefox on my desktop but on Chrome on Android the log in buttons aren’t there. Also, there are footer links which aren’t visible on desktop (Home, Categories, FAQ/Guidelines, etc.) and it says “Powered by Discourse, best viewed with JavaScript enabled”

Chrome 67.0.3396.87
Android 8.0.0
Debian 8.10
Latest Discourse, updated through admin

I’ve tried debugging remotely with Chrome dev tools through USB but so far haven’t had any luck working out what’s wrong.

Any ideas?

[edit] Forgot to add, it works fine on an old phone with the same Chrome version. It’s only happening on my newer phone Cubot X18 Plus.


(Joshua Rosenfeld) #2

If you’re seeing that it implies JavaScript isn’t running in your browser. I’d check that JavaScript isn’t somehow disabled in Chrome. On my phone that’s found via Chrome -> menu -> Settings -> Site settings -> JavaScript.


Thanks, that’s the weird thing. Javascript is enabled and works on every other site but for some reason Discourse seems not be detecting it and showing what I think is the crawler layout which means it’s unusable on my phone.

I wonder if there’s a setting I can change in Chrome to help it detect JS. I’d like to use Discourse for a new site I’m working on but if I’m getting this problem I doubt I’m the only one.

(Sam Saffron) #4

Other option is that you have hacked up your user agent in such a way that it is telling us it is a crawler.


Thanks, Sam. You’re exactly right, it’s the user agent that my phone is using.

Mozilla/5.0 (Linux; Android 8.0.0; CUBOT_X18_Plus Build/O00623) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3457.4 Mobile Safari/537.36

I’ve tried using this user agent (with a Chrome extension) on desktop and the same thing happens. I’ve no idea if there’s a way to change the user agent on Chrome for Android though. Is there anything I can change on the server end?

(Rafael dos Santos Silva) #6

We match the user agent with:

So the presence of the bot substring is tripping us.


Thanks Rafael, yes can confirm by taking ‘bot’ out of crawler_user_agents I can now log in. :slight_smile:

I don’t suppose this will affect many users then, probably just Cubot brand phone users. Thanks again for your help here.

(Jeff Atwood) #8

Hmm @sam “bot” is kind of mega aggressive as a “match anywhere 3 character string” here.

(Sam Saffron) #9

Yeah agree, we need to change it to <space of sorts>bot<space of sorts>. I will look at making this change today.

(Jeff Atwood) #11

“rss” is slightly less risky (I think “bot” will naturally occur in more words?) but same basic concern there.

Also we should probably backport this fix due to the risk of support requests it could create over time.

(Sam Saffron) #12

The reason I went with “bot” is cause it had so little false positives.

See: bots.csv · GitHub

This is top 100,000 user agents we saw in the last 48 hours with case insensitive “bot” string.

The false positives appear to be CUBOT stuff with agents such as:

Mozilla/5.0 (Linux; Android 6.0; CUBOT DINOSAUR Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Mobile Safari/537.36
Mozilla/5.0 (Linux; Android 7.0; CUBOT CHEETAH 2 Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.125 Mobile Safari/537.36

And logicom stuff that is even worse cause the exact string bot is included.

Mozilla/5.0 (Linux; Android 7.0; M bot 54 Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.111 Mobile Safari/537.36

Now … I can not require bot alone cause googlebot, applebot and tons of others. I can not require ending with bot cause it does nothing to solve cubot

Which leaves me with only 1 option here, another setting for “if you see this text I am not a bot” and then have cubot in it.

I am not sure I want to backport this, but first we got to decide on an approach.

An alternative here is to allow “bots” to click something to get the “real view” … which is the most flexible. Eg: “Are you not a bot? click here for the full website”

That is the alternative I like most actually.

(Jeff Atwood) #13

Might be worth waiting to see how many instances of this we hit.

(Sam Saffron) #14

Was a very easy fix, most of the time I spent learning how to edit vim macros, cause our user agent tests were getting unreadable.

I think the surface area of cubot devices is small enough that we do not need to backport