Detect browser

Get help using Construct 2

Post » Thu Jun 18, 2015 12:18 pm

How do I detect which browser i use?
B
118
S
32
G
50
Posts: 1,889
Reputation: 38,034

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
23
S
6
G
1
Posts: 1,419
Reputation: 4,867

Post » Thu Jun 18, 2015 11:35 pm

Browser.Product
ImageImageImage
B
71
S
22
G
274
Posts: 3,826
Reputation: 151,295

Post » Fri Jun 19, 2015 6:00 am

@gumshoe2029 @blackhornet ok, now how detect this in c2 events
B
118
S
32
G
50
Posts: 1,889
Reputation: 38,034

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
28
S
9
G
4
Posts: 359
Reputation: 4,246

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
22
G
274
Posts: 3,826
Reputation: 151,295

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
118
S
32
G
50
Posts: 1,889
Reputation: 38,034

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
22
G
274
Posts: 3,826
Reputation: 151,295


Return to How do I....?

Who is online

Users browsing this forum: LukeW and 7 guests