Detect browser

Get help using Construct 2

Post » Thu Jun 18, 2015 12:18 pm

How do I detect which browser i use?
B
111
S
28
G
48
Posts: 1,882
Reputation: 36,428

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,857

Post » Thu Jun 18, 2015 11:35 pm

Browser.Product
ImageImageImage
B
71
S
22
G
249
Posts: 3,763
Reputation: 138,577

Post » Fri Jun 19, 2015 6:00 am

@gumshoe2029 @blackhornet ok, now how detect this in c2 events
B
111
S
28
G
48
Posts: 1,882
Reputation: 36,428

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
26
S
8
G
4
Posts: 336
Reputation: 4,050

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
249
Posts: 3,763
Reputation: 138,577

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
111
S
28
G
48
Posts: 1,882
Reputation: 36,428

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
249
Posts: 3,763
Reputation: 138,577


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 25 guests