IE6ify Bookmarklet

After years of observation and reverse engineering I am proud to say I have been able to reproduce the IE6 algorithm to break even the most standards-compliant websites.

Source (elbertf.com)


Download Bookmarklet:


View Bookmarklet Code:

Bookmarklet Source Code:

javascript%3A%28function%28%29%7Bvar%2520i%3D0%2Cr%3Dfunction%28n%29%7Breturn%2520Math.floor%28Math.random%28%29*n%29%7D%2Cf%3Ddocument.getElementsByTagName%28%27body%27%29%5B0%5D.getElementsByTagName%28%27*%27%29%2Co%3Dfunction%28e%29%7Breturn%2520typeof%28e.style%29%3D%3D%27object%27%26%26e.tagName%21%3D%27SCRIPT%27%7D%2Cs%3Dfunction%28%29%7Bwhile%28%21o%28e%3Df%5Br%28f.length%29%5D%29%29%7B%7Dreturn%2520e.style%7D%3Bwhile%28i++%3C5%29%7Bs%28%29.display%3Dr%282%29%3F%27block%27%3A%27inline%27%3Bs%28%29.position%3Dr%282%29%3F%27absolute%27%3A%27relative%27%3Bs%28%29.margin%3Dr%282%29%3F%270%27%3A%271em%27%3Bs%28%29.padding%3Dr%282%29%3F%270%27%3A%271em%27%3Bs%28%29.width%3Dr%282%29%3F%27%27%3A%27auto%27%3B%7D%7D%29%28%29%3B


Rate it:


Tags:

Comments

Comments so far. Add yours.

Name...

javascript: (function() {
var i = 0,
r = function(n) {
return Math.floor(Math.random() * n)
}, f = document.getElementsByTagName('body')[0].getElementsByTagName('*'),
o = function(e) {
return typeof(e.style) == 'object' && e.tagName != 'SCRIPT'
}, s = function() {
while (!o(e = f[r(f.length)])) {}
return e.style
};
while (i++ < 5) {
s().display = r(2) ? 'block' : 'inline';
s().position = r(2) ? 'absolute' : 'relative';
s().margin = r(2) ? '0' : '1em';
s().padding = r(2) ? '0' : '1em';
s().width = r(2) ? '' : 'auto';
}
})();