1. injectInterface();if(window.location.href.match(".steamgifts.com/discussion/")!==null&&confirmAuthor()){var apiKey=localStorage.getItem('APIKey');var steamID64=localStorage.getItem('SteamID64');appIDs=scanTable()[0];subIDs=scanTable()[1];if(appIDs.length>0){importJSON(appIDs);}
  2. if(subIDs.length>0){for(i=0;i<subIDs.length;i++){getApps(subIDs[i]);}}}
  3. function injectInterface(){injectDlgStyle();injectDialog();injectFunctions();injectRow();}
  4. function injectFunctions(){var scriptcode=["function retrieveChecked() {"," if (localStorage.getItem('MBlueTheme') == 'true') {"," document.getElementById('MBlueTheme').checked = true;"," }"," if (localStorage.getItem('MDarkTheme') == 'true') {"," document.getElementById('MDarkTheme').checked = true;"," }"," if (localStorage.getItem('SPDarkTheme') == 'true') {"," document.getElementById('SPDarkTheme').checked = true;"," }","}","","retrieveChecked();"].join("\n");var node=document.createElement('script');node.type="text/javascript";node.appendChild(document.createTextNode(scriptcode));document.head.appendChild(node);}
  5. function injectRow(){var discDropdown=document.getElementsByClassName('nav__left-container')[0].children[3].children[0].children[0];var newRow=document.createElement('a');newRow.setAttribute('class','nav__row');newRow.href="javascript:void(0)";if(document.getElementsByClassName('nav__left-container')[0].children[0].tagName=="IMG"||document.getElementsByClassName('SPGG_FixedNavbar')>=1||document.getElementsByClassName('sg-info').length>=1){setTimeout(function(){if(document.getElementsByClassName('nav__left-container')[0].children[0].tagName=="IMG"&&document.getElementsByClassName('SPGG_FixedNavbar')>=1&&document.getElementsByClassName('sg-info').length>=1){document.getElementsByClassName('nav__left-container')[0].children[4].children[0].children[0].insertBefore(newRow,discDropdown.children[2]);}else if(document.getElementsByClassName('nav__left-container')[0].children[0].tagName=="IMG"&&document.getElementsByClassName('sg-info').length>=1){document.getElementsByClassName('nav__left-container')[0].children[4].children[0].children[0].insertBefore(newRow,document.getElementsByClassName('nav__left-container')[0].children[4].children[0].children[0].children[2]);}else if(document.getElementsByClassName('sg-info').length>=1){discDropdown.insertBefore(newRow,discDropdown.children[2]);}else if(document.getElementsByClassName('nav__left-container')[0].children[0].tagName=="IMG"){ document.getElementsByClassName('nav__left-container')[0].children[4].children[0].children[0].appendChild(newRow);}else{discDropdown.appendChild(newRow);}},1000);}else{discDropdown.appendChild(newRow);}
  6. newRow.appendChild(document.createElement('i'));newRow.children[0].setAttribute('class','icon-blue fa fa-fw fa-table');newRow.appendChild(document.createElement('div'));newRow.children[1].setAttribute('class','nav__row__summary');newRow.children[1].appendChild(document.createElement('p'));newRow.children[1].children[0].setAttribute('class','nav__row__summary__name');newRow.children[1].children[0].innerHTML="RaChart&trade; Enhancer";newRow.children[1].appendChild(document.createElement('p'));newRow.children[1].children[1].setAttribute('class','nav__row__summary__description');newRow.children[1].children[1].innerHTML="Change the options for the enhancer.";newRow.addEventListener('click',function(){var blackbg=document.getElementById('black-background');var dlg=document.getElementById('dlgbox');blackbg.style.display='block';dlg.style.display='block';var winWidth=window.innerWidth;var winHeight=window.innerHeight;dlg.style.left=(winWidth/2)-500/2+'px';dlg.style.top='150px';});}
  7. function injectDialog(){var dlg=document.createElement('div');dlg.setAttribute('id','black-background');dlg.appendChild(document.createElement('div'));document.body.insertBefore(dlg,document.body.children[0]);dlg.children[0].setAttribute('id','dlgbox');dlg.children[0].appendChild(document.createElement('div'));dlg.children[0].appendChild(document.createElement('div'));var dlgHeader=dlg.children[0].children[0];dlgHeader.setAttribute('id','dlg-header');dlgHeader.appendChild(document.createElement('div'));dlgHeader.children[0].setAttribute('id','dlg-header-title');dlgHeader.children[0].innerHTML="RaChart&trade; Enhancer";dlgHeader.appendChild(document.createElement('button'));dlgHeader.children[1].setAttribute('id','closeRC');dlgHeader.children[1].appendChild(document.createElement('i'));dlgHeader.children[1].children[0].setAttribute('class','fa fa-times');dlgHeader.children[1].children[0].style.fontSize="25px";dlgHeader.children[1].children[0].style.marginTop="-6px";var dlgBody=dlg.children[0].children[1];dlgBody.setAttribute('id','dlg-body');dlgBody.appendChild(document.createElement('label'));dlgBody.children[0].htmlFor="APIKey";dlgBody.children[0].innerHTML="API Key:";dlgBody.appendChild(document.createElement('input'));dlgBody.children[1].type="textarea"; dlgBody.children[1].setAttribute('id','APIKey');dlgBody.children[1].style.marginLeft="35px";dlgBody.children[1].style.width="240px";dlgBody.children[1].style.lineHeight="inherit";dlgBody.appendChild(document.createElement('button'));dlgBody.children[2].setAttribute('class','RC-button');dlgBody.children[2].innerHTML="Submit";dlgBody.appendChild(document.createElement('br'));dlgBody.appendChild(document.createElement('label'));dlgBody.children[4].htmlFor="SteamID64";dlgBody.children[4].innerHTML="Steam ID64:";dlgBody.appendChild(document.createElement('input'));dlgBody.children[5].type="textarea";dlgBody.children[5].setAttribute('id','SteamID64');dlgBody.children[5].style.marginLeft="10px";dlgBody.children[5].style.width="240px";dlgBody.children[5].style.lineHeight="inherit";dlgBody.appendChild(document.createElement('button'));dlgBody.children[6].setAttribute('class','RC-button');dlgBody.children[6].innerHTML="Submit";dlgBody.appendChild(document.createElement('br'));dlgBody.appendChild(document.createElement('label'));dlgBody.children[8].htmlFor="PrimaryColor";dlgBody.children[8].innerHTML="Primary color (for valid rows):";dlgBody.appendChild(document.createElement('input'));dlgBody.children[9].type="textarea";dlgBody.children[9].setAttribute('id','PrimaryColor');dlgBody.children[9].style.marginLeft="8px";dlgBody.children[9].style.width="135px";dlgBody.children[9].style.lineHeight="inherit";dlgBody.appendChild(document.createElement('button'));dlgBody.children[10].setAttribute('class','RC-button');dlgBody.children[10].innerHTML="Submit";dlgBody.appendChild(document.createElement('button'));dlgBody.children[11].setAttribute('class','RC-button');dlgBody.children[11].innerHTML="Reset colors";dlgBody.children[11].style.width="55px";dlgBody.children[11].style.fontSize="10px";dlgBody.children[11].style.marginTop="5px";dlgBody.children[11].style.float="right";dlgBody.appendChild(document.createElement('br'));dlgBody.appendChild(document.createElement('label'));dlgBody.children[13].htmlFor="SecondaryColor";dlgBody.children[13].innerHTML="Secondary color (for partial rows):";dlgBody.appendChild(document.createElement('input'));dlgBody.children[14].type="textarea";dlgBody.children[14].setAttribute('id','SecondaryColor');dlgBody.children[14].style.width="114px";dlgBody.children[14].style.lineHeight="inherit";dlgBody.appendChild(document.createElement('button'));dlgBody.children[15].setAttribute('class','RC-button');dlgBody.children[15].innerHTML="Submit";dlgBody.appendChild(document.createElement('br'));dlgBody.appendChild(document.createElement('label'));dlgBody.children[17].htmlFor="MBlueTheme";dlgBody.children[17].innerHTML="Check this if you use Mullins' Blue Theme ";dlgBody.appendChild(document.createElement('input'));dlgBody.children[18].setAttribute('id','MBlueTheme');dlgBody.children[18].type="checkbox";dlgBody.children[18].style.width="inherit";dlgBody.children[18].style.marginTop="10px";dlgBody.appendChild(document.createElement('br'));dlgBody.appendChild(document.createElement('label'));dlgBody.children[20].htmlFor="MDarkTheme";dlgBody.children[20].innerHTML="Check this if you use Mullins' Dark Theme ";dlgBody.appendChild(document.createElement('input'));dlgBody.children[21].setAttribute('id','MDarkTheme');dlgBody.children[21].type="checkbox";dlgBody.children[21].style.width="inherit";dlgBody.children[21].style.marginTop="2px";dlgBody.appendChild(document.createElement('br'));dlgBody.appendChild(document.createElement('label'));dlgBody.children[23].htmlFor="SPDarkTheme";dlgBody.children[23].innerHTML="Check this if you use SquishedPotatoe's Dark Theme ";dlgBody.appendChild(document.createElement('input'));dlgBody.children[24].setAttribute('id','SPDarkTheme');dlgBody.children[24].type="checkbox";dlgBody.children[24].style.width="inherit";dlgBody.children[24].style.marginTop="2px";dlgBody.appendChild(document.createElement('h2'));dlgBody.children[25].style.float="right";dlgBody.children[25].style.marginTop="-2px";dlgBody.children[25].appendChild(document.createElement('a'));dlgBody.children[25].children[0].href="https://www.steamgifts.com/discussion/riOvr/";dlgBody.children[25].children[0].style.color="#FFFFFF";dlgBody.children[25].children[0].style.fontSize="20px";dlgBody.children[25].children[0].style.fontStyle= "italic";dlgBody.children[25].children[0].style.textDecoration="underline";dlgBody.children[25].children[0].innerHTML="Thread";document.getElementById('closeRC').addEventListener('click',function(){var blackbg=document.getElementById('black-background');var dlg=document.getElementById('dlgbox');blackbg.style.display='none';dlg.style.display='none';});dlgBody.children[2].addEventListener('click',function(){var input=document.getElementById('APIKey');localStorage.setItem(input.id,input.value);});dlgBody.children[6].addEventListener('click',function(){var input=document.getElementById('SteamID64');localStorage.setItem(input.id,input.value);});dlgBody.children[10].addEventListener('click',function(){var input=document.getElementById('PrimaryColor');localStorage.setItem(input.id,input.value);});dlgBody.children[11].addEventListener('click',function(){localStorage.removeItem('PrimaryColor');localStorage.removeItem('SecondaryColor');});dlgBody.children[14].addEventListener('click',function(){var input=document.getElementById('SecondaryColor');localStorage.setItem(input.id,input.value);});dlgBody.children[18].addEventListener('click',function(){var input=document.getElementById('MBlueTheme');if(input.checked==false){localStorage.removeItem('MBlueTheme');}else{localStorage.setItem(input.id,true);}});dlgBody.children[21].addEventListener('click',function(){var input=document.getElementById('MDarkTheme');if(input.checked==false){localStorage.removeItem('MDarkTheme');}else{localStorage.setItem(input.id,true);}});dlgBody.children[24].addEventListener('click',function(){var input=document.getElementById('SPDarkTheme');if(input.checked==false){localStorage.removeItem('SPDarkTheme');}else{localStorage.setItem(input.id,true);}});}
  8. function injectDlgStyle(){var dialogCSS=["#black-background {"," display: none;"," width: 100%;"," height: 100%;"," position: fixed;"," top: 0px;"," left: 0px;"," background-color: rgba(0, 0, 0, 0.75);"," z-index: 8888;","}","#dlgbox{"," display: none;"," position: fixed;"," width: 500px;"," z-index: 9999;"," border-radius: 10px;"," background-color: #7c7d7e;","}","#dlg-header {"," background-color: #6D84B4;"," padding: 10px;"," padding-bottom: 30px;"," margin: 10px 10px 10px 10px;"," color: white;"," font-size: 20px;","}","#dlg-header-title {"," float: left;","}","#dlg-body{"," clear: both;"," background-color: #C3C3C3;"," color: white;"," font-size: 14px;"," padding: 10px;"," margin: 0px 10px 10px 10px;","}","#closeRC {"," background-color: transparent;"," color: white;"," float: right;"," border: none;"," font-size: 25px;", " margin-top: -5px;"," opacity: 0.7;","}",".RC-button{"," background-color: #fff;"," border: 2px solid #333;"," box-shadow: 1px 1px 0 #333,"," 2px 2px 0 #333,"," 3px 3px 0 #333,"," 4px 4px 0 #333,"," 5px 5px 0 #333;"," color: #333;"," display: inline-block;"," padding: 4px 6px;"," position: relative;"," text-decoration: none;"," text-transform: uppercase;"," -webkit-transition: .1s;"," -moz-transition: .1s;"," -ms-transition: .1s;"," -o-transition: .1s;"," transition: .1s;","}",".RC-button:hover,",".RC-button:focus {"," background-color: #edd;","}",".RC-button:active {"," box-shadow: 1px 1px 0 #333;"," left: 4px;"," top: 4px;","}",".markdown td {"," background-color: inherit !important;","}"].join("\n");var node=document.createElement('style');node.type="text/css";node.appendChild(document.createTextNode(dialogCSS));document.getElementsByTagName('head')[0].appendChild(node);}
  9. function highlight(row){document.getElementById(row).style.textShadow="none";if(localStorage.getItem('PrimaryColor')!=null){document.getElementById(row).style.backgroundColor=localStorage.getItem('PrimaryColor');}else if(localStorage.getItem('MBlueTheme')!==null&&localStorage.getItem('MBlueTheme')!==undefined&&localStorage.getItem('MBlueTheme')!=false){document.getElementById(row).style.backgroundColor="#0E4E0E";}else if(localStorage.getItem('MDarkTheme')!==null&&localStorage.getItem('MDarkTheme')!==undefined&&localStorage.getItem('MDarkTheme')!=false){document.getElementById(row).style.backgroundColor="#0E4E0E";}else if(localStorage.getItem('SPDarkTheme')!==null&&localStorage.getItem('SPDarkTheme')!==undefined&&localStorage.getItem('SPDarkTheme')!=false){document.getElementById(row).style.backgroundColor="#0E4E0E";}else{document.getElementById(row).style.backgroundColor="#C2FFAD";}}
  10. function highlightSub(row){document.getElementById(row).style.textShadow="none";if(localStorage.getItem('SecondaryColor')!==null){document.getElementById(row).style.backgroundColor=localStorage.getItem('PrimaryColor');}else if(localStorage.getItem('MBlueTheme')!==null&&localStorage.getItem('MBlueTheme')!==undefined&&localStorage.getItem('MBlueTheme')!=false){document.getElementById(row).style.backgroundColor="rgba(120, 154, 201, 0.70)";}else if(localStorage.getItem('MDarkTheme')!==null&&localStorage.getItem('MDarkTheme')!==undefined&&localStorage.getItem('MDarkTheme')!=false){document.getElementById(row).style.backgroundColor="rgba(120, 154, 201, 0.70)";}else if(localStorage.getItem('SPDarkTheme')!==null&&localStorage.getItem('SPDarkTheme')!==undefined&&localStorage.getItem('SPDarkTheme')!=false){document.getElementById(row).style.backgroundColor="rgba(255, 112, 67, 0.60)";}else{document.getElementById(row).style.backgroundColor="#FFD68F";}}
  11. function confirmAuthor(){var author=document.getElementsByClassName('comment__username')[0].children[0].innerHTML;if(author=="rachellove"){return true;}
  12. else{return false;}}
  13. function scanTable(){var elements=document.getElementsByTagName('td');var appIDs=[];var subIDs=[];for(var i=0;i<elements.length;i++){if(elements[i].children.length>=1){if(elements[i].children[0].tagName=="STRONG"){if(/app/.test(elements[i].children[0].children[0].href)){var id=/\d+/.exec(elements[i].children[0].children[0].href)[0];appIDs.push(id);elements[i].parentNode.setAttribute('id',"app/"+id);}else if(/sub/.test(elements[i].children[0].children[0].href)){var id=/\d+/.exec(elements[i].children[0].children[0].href)[0];subIDs.push(id);elements[i].parentNode.setAttribute('id',"sub/"+id);}}}}
  14. var array=[appIDs,subIDs];return array;}
  15. function importJSON(appids_filter){var int_appids_filter=turnToIntArray(appids_filter);var link="https://api.steampowered.com/IPlayerService/GetOwnedGames/v1/?key="+apiKey+'&input_json={"steamid":'+steamID64+',"appids_filter":'+JSON.stringify(int_appids_filter)+"}";var jsonFile;GM_xmlhttpRequest({method:"GET",url:link,timeout:5000,onload:function(response){jsonFile=JSON.parse(response.responseText);if(jsonFile.response.game_count>0){for(var i=0;i<jsonFile.response.games.length;i++){highlight("app/"+jsonFile['response']['games'][i]['appid']);}}},});}
  16. function getApps(subID){var link="https://store.steampowered.com/api/packagedetails/?packageids="+subID;GM_xmlhttpRequest({method:"GET",url:link,timeout:3000,onload:function(response){var jsonFile=JSON.parse(response.responseText);var arrayApps=[];for(var j=0;j<jsonFile[subID]['data']['apps'].length;j++){arrayApps.push(jsonFile[subID]['data']['apps'][j]['id']);}
  17. var int_appids_filter=turnToIntArray(arrayApps);var checkGames="https://api.steampowered.com/IPlayerService/GetOwnedGames/v1/?key="+apiKey+'&input_json={"steamid":'+steamID64+',"appids_filter":'+JSON.stringify(int_appids_filter)+"}";GM_xmlhttpRequest({method:"GET",url:checkGames,onload:function(response){var jsonFile=JSON.parse(response.responseText);if(jsonFile['response']['game_count']==arrayApps.length){highlight("sub/"+subID);}
  18. else if(jsonFile['response']['game_count']!=0){highlightSub("sub/"+subID);}}});}});}
  19. function turnToIntArray(oldArray){var newArray=[];for(var i=0;i<oldArray.length;i++){newArray.push(parseInt(oldArray[i]));}

rachart ,while opgforum is open