Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Some games have buttons that would actually let you click them and you'd log right into the game. How does the web browser get permission to do this without plugins? Perhaps the client registers a custom protocol URL?

They used to be popular a few years back - I can't remember any implementations off the top of my head. On desktop browsers, if your game client was installed clicking 'Play' on the home page would boot up the game begin it with you already signed in. It was popular with arcade games so you could browse the sessions on the web and then simply hit 'Start'. You didn't need any browser plugins.

share|improve this question
2  
I'm interested in this topic, but I have no idea what you're talking about. How about showing an example? or at least mention the platform (desktop? mobile?) –  Panda Pajama Apr 24 '13 at 2:14
    
@PandaPajama I added a bit more detail - perhaps this is enough? –  Vaughan Hilts Apr 24 '13 at 2:17
    
If I remember correctly, this game does what you describe. dungeonfighter.nexon.net I don't have this installed anymore so I can't confirm. –  XiaoChuan Yu Apr 24 '13 at 7:46
    
Doesn't Battlefield 3 work that way? But I think it requires a browser plugin. –  Laurent Couvidou Apr 24 '13 at 10:35

1 Answer 1

up vote 2 down vote accepted

I have not seen any games that do this, but I can think of a few ways to achieve this. Keep in mind that any solution will be browser and OS dependent, so you must offer alternative ways to start your game.

In general, my approach would consist of running your game's executable file from the browser. Here are some ideas I just made out. I'm not really sure whether or not they work for your purposes, or if they even work at all, but they may give you some ideas.

  1. WScript.Shell. Only works on IE, but is probably your most flexible choice.

  2. The mozilla.org/process XPCOM component would do the same thing in Firefox.

  3. Execute the program from a signed Java applet. I haven't done applets in ages, but last time I checked, you could access local data XOR the internet from an applet, if it is properly signed.

  4. Execute the program from a flash applet. This would be very similar to the Java applet.

  5. Have the browser download a file with a custom extension, which your game previously registered. This requires a confirmation dialog, but is probably the most portable.

  6. Have the link point to a custom URL scheme/activity which was previously registered by your game. This only works on iOS/Android, and is the mobile analog of the previous point.

  7. Use a plugin. Most likely your game installer requires admin privileges, so use these privileges to install plugins for the currently found browser(s).

  8. Make the button into a link to the locally installed game executable (via file://). This will fail when the game is not installed though.

But, if you can find a working example, you can check the page source, and at least get a hint of how they're doing it.

share|improve this answer
2  
Custom URL schemes work on desktop platforms too (though recently they have sometimes been restricted due to security problems with poorly implemented handlers). For example, Steam uses them. –  Kevin Reid Apr 24 '13 at 4:56
    
@KevinReid: You're right. I have no experience with custom URL schemes on the desktop though. –  Panda Pajama Apr 24 '13 at 5:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.