Browser Detection - Activation/Deactivation?

0 favourites
  • 5 posts
From the Asset Store
Detects any kind of ad blocker. Very easy implementation into already existing projects
  • I was wondering; is there a way in C2 to make your HTML5 game detect what browser the user is playing your game on, and then only allow the game to play if the browser is correct? For example:

    Person is playing the Wii U with the Wii U's browser. Person goes to play your game. The game detects that the user is using the Wii U browser and the game boots.

    Another person attempts to access your game from another browser... the game automatically disables because it recognizes that it's not the Wii U browser and won't allow access.

    Thoughts?

  • The browser object can detect the browser name already. However it is not recommended to make games for the wii U's browser, which features extremely limited HTML5 capability.

  • The app I was thinking of doing wouldn't require sound or character animation, so I'd probably be able to skate around the current issues with the Wii U and HTML5 games.

    Any idea on how to make a C2 program detect a specific browser? I'm not well-versed in C2 yet, I'm looking at the demo. I see the Browser object, but I don't see any detection actions. Perhaps I'm missing something?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You can use the user agent string from the Browser object, but this is *not recommended*. You should never block people entirely, just give them a choice - otherwise if your detection is buggy you'll be blocking people who could have legitimately played the game. Also note most browsers can fake their user agent string for compatibility reasons, so it's not a very reliable thing to work with in the first place.

  • ^Ah, gotcha. Works well. Thanks, Ashley!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)