Detect browser

Get help using Construct 2

Post » Thu Jun 18, 2015 12:18 pm

How do I detect which browser i use?
B
109
S
26
G
46
Posts: 1,887
Reputation: 35,170

Post » Thu Jun 18, 2015 11:32 pm

It is in the HTTP request headers.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,416
Reputation: 4,826

Post » Thu Jun 18, 2015 11:35 pm

Browser.Product
ImageImageImage
B
71
S
21
G
233
Posts: 3,697
Reputation: 130,370

Post » Fri Jun 19, 2015 6:00 am

@gumshoe2029 @blackhornet ok, now how detect this in c2 events
B
109
S
26
G
46
Posts: 1,887
Reputation: 35,170

Post » Fri Jun 19, 2015 7:13 am

@blackhornet, this is not effective because the "Browser.Product" is reported as "Gecko". Detecting the browser name by Construct 2's expressions isn't effective yet. @delgado, for now you can ask for help for using custom Javascript, instead. Good luck.
Liked something I say?
Tip. My Bitcoin address: 1PLaeKmXQ8vEdGGJqXMq3KyB8hxeddxeSv
B
24
S
7
G
4
Posts: 326
Reputation: 3,878

Post » Fri Jun 19, 2015 12:26 pm

Add the Browser plugin, and use the expression Browser.Product. There are various expressions to get details of the Browser. You'll have to see if they meet your needs.
https://www.scirra.com/manual/110/browser
ImageImageImage
B
71
S
21
G
233
Posts: 3,697
Reputation: 130,370

Post » Fri Jun 19, 2015 12:49 pm

@blackhornet Browser is great plugin. You mean type "Browser.Product" to execute javascript?
i need only simple condition and event.
When game is opened on chrome do something but when is FF do other thing
B
109
S
26
G
46
Posts: 1,887
Reputation: 35,170

Post » Fri Jun 19, 2015 4:05 pm

Actually you can parse it out of the UserAgent field:

System.CompareTwoValues: find(uppercase(Browser.UserAgent),"FIREFOX") > 0
ImageImageImage
B
71
S
21
G
233
Posts: 3,697
Reputation: 130,370


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 15 guests