Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function()
- {
- if( !location.href.startsWith( 'https://store.steampowered.com/account/licenses' ) )
- {
- alert( 'Please run this on Steam\'s account licenses page.' );
- window.location = 'https://store.steampowered.com/account/licenses/';
- return;
- }
- let freePackages = new Set( [
- 251040
- 251041
- 21230
- ] );
- [ ...document.querySelectorAll( 'a[href^="javascript:RemoveFreeLicense"]' ) ].forEach( ( element ) =>
- {
- const match = element.href.match( /javascript:RemoveFreeLicense\( ([0-9]+), '/ );
- if( match !== null )
- {
- freePackages.delete( +match[ 1 ] );
- }
- } );
- let loaded = 0;
- let modal = window.ShowBlockingWaitDialog(
- 'Executing…',
- 'Please wait until all requests finish. Ignore all the errors, let it finish.'
- );
- const fetched = ( res ) =>
- {
- modal.Dismiss();
- if( ++loaded >= freePackages.length )
- {
- modal = window.ShowBlockingWaitDialog(
- 'Reloading…',
- 'Keep in mind only 50 packages can be activated per hour.'
- );
- location.reload();
- }
- else
- {
- modal = window.ShowBlockingWaitDialog(
- 'Executing…',
- `Loaded <b>${loaded}</b>/${freePackages.length}.`
- );
- }
- };
- freePackages = [ ...freePackages ].slice( -50 );
- for( const subid of freePackages )
- {
- window.jQuery.post(
- 'https://store.steampowered.com/checkout/addfreelicense/' + subid,
- {
- ajax: true,
- sessionid: window.g_sessionID,
- }
- ).always( fetched );
- }
- }());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement