<iframe id="loader" style="display:none"
height="0" width="0"></iframe>
var loader = document.getElementById("loader");
loader.src = "steam://url/CommunityFilePage/95359349";
Hack on,
Michiel
Willem came across an interesting article about Greenlight over at Gamasutra, which contained a useful tip I wanted to share with you. By linking to a URL using the steam:// protocol and an undocumented feature of the Steam client, you can link directly to a game's Greenlight page, inside Steam. The user is generally already logged in to Steam, making it much easier for them to vote. The URL in question is steam://url/CommunityFilePage/95359349, with the number replaced by your account identifier. The article sends the browser to this URL using server side scripting, but some Javascript works equally well if you prefer a client side solution. Here's what I set up at www.powargrid.com/greenlight - have a peek at the source if you want! First, an invisible iframe to do the loading in. In several browsers, this prevents an error message if Steam is not installed. <iframe id="loader" style="display:none" Then some Javascript to "load" the Steam URL. var loader = document.getElementById("loader"); That's it! I tried to get fancy and make it load the normal Greenlight page if the user doesn't have Steam installed, but making that work across different browsers turned out to be a pain in the neck. Instead, I just included a regular link people will have to click themselves. That's all, maybe it'll be of use to someone!
Hack on, Michiel
1 Comment
|
AuthorWe're Michiel and Willem. Hi! Archives
June 2017
Categories |