youtube has started rolling out a new ui. It seems to appear randomly, but can be forced with this url from the blog post.
The new version detection code seems to be (it's obfuscated) on line 30 and is doing basically the following:
Code: Select all
<html>
<head>
<script>
function checkFlash()
{
var body = document.getElementsByTagName("body")[0];
var flashObj = document.createElement("object");
flashObj.setAttribute("type", "application/x-shockwave-flash");
var flashEl = body.appendChild(flashObj);
alert(flashEl);
var hasGetVariable = "GetVariable" in flashEl;
alert(hasGetVariable);
if (hasGetVariable)
alert(flashEl.GetVariable("$version"));
body.removeChild(flashObj);
}
</script>
</head>
<body>
<button onclick="checkFlash();">check flash version</button>
</body>
<html>