Keeping the Morlocks underground



  • So, I was looking at the great IPv6 tester for Google and was interested in how they determined if your browser could support it.  Then I noticed this morsel of Javascript http://ipv6test.google.com/default.js

     

    This is what makes developers cry.  When code is minified and variables are named obtusely makes it dificult to reverse-engineer what's going on.

     



  •  Please tell me you are joking. This is a joke right? Come on, you can't be that stupid.

     
    [Edit]
    Here is a human readable source code for same thing: http://ipv6blog.net/ipv6-validation-javascript/ (4th result on google for "ipv6 test javascript").



  • @Hasteur said:

    This is what makes developers cry.
     

    Why?



  • You say Javascript minification and terse, abstract variable names make it difficult for developers to reverse-engineer.

    I say they make it FUN!

     

     



  •  That's standard operating procedure for JavaScript. It's called minimizing, and it removes comments, unnecessary white space, and shortens variable names so that the file is as small as possible for easy downloading. The developers did not code it this way, they coded it in a more readable format (as readable as JS can get, anyway) and then used a JS minimizer to produce what you see there. It's the closest you can get to "compiling" JS.

    No WTF, nothing to see here.



  • @Hasteur said:

    This is what makes developers cry.  When code is minified and variables are named obtusely makes it dificult to reverse-engineer what's going on.

     

    Well, it's more challenging, sure. But human-readability is not the point of "minifying" code...


  • If the code wasn't specifically made open-source then there's no point in keeping it human-readable for the user.

    And if it is open-source, then the actual source may be provided separately...



  • I'm more concerned by the results of my test:

    No problems detected. -- You don’t have IPv6, but you shouldn’t have problems on websites that add IPv6 support.

    So tell me, how will I not "have problems" on IPv6 sites without IPv6 in the first place? Plus, a "support" test like this probably shouldn't display a huge green checkmark for what is basically a failure condition.



  • @MiffTheFox said:

    I'm more concerned by the results of my test:

    No problems detected. -- You don’t have IPv6, but you shouldn’t have problems on websites that add IPv6 support.

    So tell me, how will I not "have problems" on IPv6 sites without IPv6 in the first place? Plus, a "support" test like this probably shouldn't display a huge green checkmark for what is basically a failure condition.

     

    It's more like:
    Test 1: Check if user is on IPv6.
    Test 2: If user is not running IPv6, check if he can connect to a IPv6.

     You don't really have to be on an IPv6 to be able to connect to IPv6.

    So much stupidity in this thread >_<

     



  • Wait, what?

    The test says you shouldn't have problems connecting to sites that ADD IPv6 support, not that ONLY support it.  If I have a gas station and I start selling diesel as well as unleaded, you're not going to cry and say "how will my car work, it doesn't even USE diesel!" are you?



  • @Sutherlands said:

    Wait, what?

    The test says you shouldn't have problems connecting to sites that ADD IPv6 support, not that ONLY support it.  If I have a gas station and I start selling diesel as well as unleaded, you're not going to cry and say "how will my car work, it doesn't even USE diesel!" are you?

     

    What I meant to say. +1

     



  • Honestly, has none of you ever heard of Google Web Toolkit? (Basically it is a converter of typed Java code to obfuscated JavaScript code plus a nice "hosted mode" webserver with a "debugger" mode where you can set breakpoints in your Java code that will be triggered dynamically from your browser).

    The generated code looks ugly as hell, but coding with GWT is something you should at least have tried, if you are a Java/JSP coder.

    (The resulting JavaScript code does not require a Java-capable webserver, if that was the reason that prevented you from trying)



  • @mihi said:

    Honestly, has none of you ever heard of Google Web Toolkit? (Basically it is a converter of typed Java code to obfuscated JavaScript code plus a nice "hosted mode" webserver with a "debugger" mode where you can set breakpoints in your Java code that will be triggered dynamically from your browser).

    The generated code looks ugly as hell, but coding with GWT is something you should at least have tried, if you are a Java/JSP coder.

    (The resulting JavaScript code does not require a Java-capable webserver, if that was the reason that prevented you from trying)


    If by "none of you" you mean Hasteur, then possibly.  If by "none of you" you mean "none of you" then RTFT.



  • @Hasteur said:

    So, I was looking at the great IPv6 tester for Google and was interested in how they determined if your browser could support it.  Then I noticed this morsel of Javascript http://ipv6test.google.com/default.js

    This is what makes developers cry.  When code is minified and variables are named obtusely makes it dificult to reverse-engineer what's going on.


    1. Open script in Firefox.
    2. Type [code]new Function(document.body.textContent).toString()[/code] into Firebug.
    3. ???
    4. Profit.

    It's not rocket science.

    [edit]

    ...and, apparently this is the whole magic: How can they determine ipv6 support from looking at your browser? Answer: They don't.




  • @Sutherlands said:

    Wait, what?

    The test says you shouldn't have problems connecting to sites that ADD IPv6 support, not that ONLY support it.  If I have a gas station and I start selling diesel as well as unleaded, you're not going to cry and say "how will my car work, it doesn't even USE diesel!" are you?

    They could have written the test a lot simpler then:
    document.write("Congratulations! I don't care wether you suport IPv6 or not, because it will never replace IPv4 anyway!");


  • The real WTF seems to be that at least Finnish translation is way off.

    Oletko valmis tulevaisuuden internetin käyttöön? 
    
    Vaikuttaa siltä, että olet valmis. 
    
     Voit muodostaa yhteyden IPv6:ta käyttäviin sivustoihin. 
    
     Voit muodostaa yhteyden IPv6:ta käyttäviin sivustoihin Maailman IPv6-päivänä 8. kesäkuuta.
    

    Which would translate to

    Are you ready for future internet use?
    

    Seems like you are.

    You can connect to sites that use IPv6.

    You can connect to sites that use IPv6 during World IPv6 day, June 8th.

    And no, I don't have external IPv6 connectivy.



  • @PSWorx said:

    1. Open script in Firefox.
    2. Type <font face="Lucida Console" size="2">new Function(document.body.textContent).toString()</font> into Firebug.
    3. ???
    4. Profit.

    It's not rocket science.

     

    But it is a neat tip, thanks!

     


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.