JavaScript (108102 characters)
This will work in no other browser than Mozilla Firefox because it uses the nonstandard "expression closures" extension to ECMAScript that only Mozilla supportsRequires support for arrow functions. This will work unmodified in JavaScript Shell or otherwise when print is changed to alert.
for(j=k=l=-~'',j=++j+j,j*=++j;j--;)print(k=(''+k).replace(RegExp('(.)\\'+l+'*','g'),function(a,b)a=>a.length+b))