1 2document.addEventListener( "DOMContentLoaded", InitRefresh ); 3 4function InitRefresh() 5{ 6 if ( typeof window.g_wapit === 'string' || typeof window.g_wapitExpiry === 'number' ) 7 { 8 try 9 { 10 var expiry; 11 12 if ( typeof window.g_wapit === 'string' ) 13 { 14 var body = JSON.parse( atob( window.g_wapit.split( '.' )[1] ) ); 15 if ( typeof body.exp === 'number' ) 16 { 17 expiry = body.exp; 18 } 19 } 20 else 21 { 22 expiry = window.g_wapitExpiry; 23 } 24 25 var offset = Math.floor( Math.random() * 600 ) + 1800; 26 var timeout = ( expiry - offset ) * 1000 - Date.now(); 27 window.setTimeout( AutoRefresh, timeout ); 28 } 29 catch ( err ) {} 30 } 31} 32 33function AutoRefresh() 34{ 35 if ( window.g_wapitRefreshEnabled ) 36 Refresh(); 37} 38 39function Refresh( onRefreshed ) 40{ 41 42 $J.ajax( { 43 type: 'POST', 44 url: 'https://login.steampowered.com/jwt/ajaxrefresh', 45 data: { redir: window.location.href }, 46 crossDomain: true, 47 xhrFields: { withCredentials: true }, 48 } ).done( function( response ) 49 { 50 51 if ( !response.success ) 52 return; 53 54 $J.ajax( { 55 type: 'POST', 56 url: response.login_url, 57 data: Object.assign( response, { prior: window.g_wapit } ), 58 } ).done( function( response ) 59 { 60 61 if ( response.result === 1 && response.token ) 62 { 63 window.g_wapit = response.token; 64 window.g_wapitExpiry = response.rtExpiry; 65 InitRefresh(); 66 67 if ( typeof onRefreshed === 'function' ) 68 onRefreshed( response.token ); 69 } 70 } ); 71 } ); 72} 73 74window.g_wapitRefresh = Refresh; 75window.g_wapitRefreshEnabled = true;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.