Html5 sitelock problem

Hi, did anyone have solution for sitelock html5 game?
I need get current ulr, in flash target is Lib.current.stage.loaderInfo but in html5 is undefined.
Best regards, Victor

you could use:

#if js
var url = untyped __js__("document.URL");

that would get you the full url of the document where the game is loaded ( )

Thank you!

This should be implemented now in the core:


1 Like

Great. Thanks for solution.
I’m use document object too by:

Maybe we can also implement “root.loaderInfo.parameters” for HTML5 using the following haxe snippet:

   //translated from
    function getQueryVariable(variable):String
           var query:String =;
           var vars:Array<string> = query.split("&");
           for ( i in 0...vars.length) {
                   var pair:Array<string> = vars[i].split("=");
                   if(pair[0] == variable){return pair[1];}

Do you think that the parameters should be based on a GET string in the site URL, or do you think that it should be based on an embed value, like you have in SWFObject for Flash?

If I wanted access to the URL parameters in HTML5, I’d want access in Flash too. I’d have to parse the URL myself regardless of which one you chose.