/* This isn't tested and is not recommended for use. Use at your own risk. Large parts of code are taken from https://steamdb.info/freepackages/ */ var removeLinks = jQuery('.account_table a'); var total = removeLinks.length; var loaded = 0; var modal = ShowBlockingWaitDialog( 'Executing…', 'Please wait until all requests finish. Ignore all the errors, let it finish.'); removeLinks.each(function(i, el) { var match = el.href.match( /javascript:RemoveFreeLicense\( ([0-9]+), '/ ); if(match !== null) { var packageid= +match[1]; jQuery.post( 'https://store.steampowered.com/account/removelicense', { sessionid: g_sessionID, packageid: packageid } ).always(function() { loaded++; modal.Dismiss(); if(loaded >= total) { location.reload(); } else { modal = ShowBlockingWaitDialog( 'Executing…', 'Loaded ' + loaded + '/' + total + '.' ); } }); } else { loaded++; } });