Skip to content

Instantly share code, notes, and snippets.

@vmysla
Created July 16, 2015 13:32
Show Gist options
  • Save vmysla/0eb5c248cfb7f7b017ef to your computer and use it in GitHub Desktop.
Save vmysla/0eb5c248cfb7f7b017ef to your computer and use it in GitHub Desktop.
Snippet Load method randomization
console.clear();
// localStorage.setItem('rr', 'alert(1)' )
localStorage.setItem('rr', '' );
(function rr(cb, now, obj,attr,val, ls, ver){
//obj[ ver = (now & 1) ] [ ( attr[ ver<<1 || eval( ls && ls.getItem( val[0] ) || (now>>1 & 1) ) ] ) ]= val[ver];
console.log( obj[ ver = (now & 1) ] +'["' + ( attr[ ver<<1 || eval( ls && ls.getItem( val[0] ) || (now>>1 & 1) ) ] ) + '"]="' + val[ver]+'"');
})( 0, Date.now(), ['window', 'document.scripts[0]'], ['onload' , 'onscroll', 'src'], ['rr', '//rastabacher.com/'], this.localStorage
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment