- Home /
Is it possible to easily extract arguments from web build URL?
Does web build has some quick way to get attributes from link to it. I mean I need to pass some parameters in the url to game web client. Thanks.
Answer by Lucas Meijer 1 · Jan 29, 2010 at 01:51 PM
You can use Application.absoluteURL, and use a url like http://domain.com/DannysHotGame.unity3d?difficulty=easy
You could also use Application.ExternalEval() to run some javascript in the browser, and write out some javascript in your html page that returns the information you want.
Application.absoluteURL returns the URL without parameters (ends with .unity3d), so this approach doesn't work.
I tried the Application.ExternalEval() route and succeeded. It wasn't very straight forward though, using some undocumented or barely documented functionality, so I created a class for this and shared it on my company's blog, with some more information on how it works:
http://www.previewlabs.com/reading-url-parmeters-from-web-player-builds
Your answer
![](https://koobas.hobune.stream/wayback/20220612041336im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How would I go about getting the results of a javascript variable to a string inside script? 3 Answers
How to access StartCoroutine in a static way 3 Answers
Once Unity loads (Web player) how do I prevent it from being *Focused*? 0 Answers
Web page questions 1 Answer
Invoke www.error in PHP 1 Answer