您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
add Community Items images
当前为
// ==UserScript== // @name steam show Community Items beta // @description add Community Items images // @namespace steam_Items_images // @author Covenant // @version 1.0 // @license MIT // @homepage // @match https://store.steampowered.com/* // @match https://steamcommunity.com/* // @match https://steamdb.info/* // @match https://www.steamcardexchange.net/* // @icon data:image/svg+xml;base64,PHN2ZyB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMjAgMTYiIHdpZHRoPSI0MCIgaGVpZ2h0PSIzMiI+CjxjaXJjbGUgc3Ryb2tlLXdpZHRoPSIxLjVweCIgY3k9IjQuNSIgY3g9IjE1LjUiIHI9IjMuNzUiIGNsYXNzPSJzdHJva2UiIHN0cm9rZT0iI0JCQkJCQiIgZmlsbD0ibm9uZSI+PC9jaXJjbGU+CjxjaXJjbGUgY3g9IjE1LjUiIGN5PSI0LjUiIHI9IjEuODU1IiBjbGFzcz0iZmlsbCIgZmlsbD0iI0JCQkJCQiI+PC9jaXJjbGU+CjxwYXRoIGQ9Ik0xMS42NTYgNC4yTDEyLjc1IDcuMTRsMi44NjUgMS4zODctNS4xMyAzLjg1My0uODY3LTIuMDktMS43NzMtLjk0MnoiIGNsYXNzPSJmaWxsIiBmaWxsPSIjQkJCQkJCIj48L3BhdGg+CjxjaXJjbGUgY3k9IjEyLjUiIGN4PSI3LjUiIHI9IjMiIGNsYXNzPSJzdHJva2UiIHN0cm9rZT0iI0JCQkJCQiIgZmlsbD0ibm9uZSI+PC9jaXJjbGU+CjxyZWN0IHRyYW5zZm9ybT0ibWF0cml4KC45MjQzMiAuMzgxNiAtLjM4NzI3IC45MjE5NiAwIDApIiByeT0iMS41MjYiIHdpZHRoPSI5LjQ3NyIgeT0iNy4xNTUiIHg9IjMuNzY3IiBoZWlnaHQ9IjMuMDUzIiBjbGFzcz0iZmlsbCIgZmlsbD0iI0JCQkJCQiI+PC9yZWN0Pgo8L3N2Zz4= // @grant GM_setValue // @grant GM_getValue // @grant GM_registerMenuCommand // @grant GM_xmlhttpRequest // @connect www.steamcardexchange.net // @connect steamcommunity.com // @run-at document-end // @noframes // ==/UserScript== var timeoutID; var appid; var is_Community_Items_Exist=true; var is_avatar_Exist=true; var ary_lang_steam=["english","japanese","latam","bulgarian","schinese","tchinese","czech","danish","dutch","finnish","french","german","greek","hungarian","italian","koreana","norwegian","polish","brazilian","portuguese","romanian","russian","spanish","swedish","thai","turkish","ukrainian","vietnamese"]; var akamaihd="steamcdn-a.akamaihd.net"; var steamstatic="cdn.cloudflare.steamstatic.com"; function create_div(class_name,is_appendChild,node,refNode){ var div=document.createElement("div"); div.classList.add('block'); div.classList.add(class_name); div.style.fontFamily="Arial, Helvetica,'Segoe UI Emoji','Noto Color Emoji','Noto Sans Mono','Yu Gothic','Meiryo','Noto Sans JP','Microsoft JhengHei','Noto Sans TC','Noto Sans Symbols 2', sans-serif"; div.style.fontWeight="100"; div.style.backgroundSize='contain'; div.style.backgroundRepeat='no-repeat'; if(is_appendChild){ node.appendChild(div); } else{node.insertBefore(div, refNode);} return div; } function create_a(text,url,class_name,is_appendChild,node,refNode){ var anchor=document.createElement("a"); anchor.href=url; anchor.innerText=text; anchor.classList.add(class_name); anchor.style.fontWeight="100"; anchor.target="_blank"; if(is_appendChild){ node.appendChild(anchor); } else{node.insertBefore(anchor, refNode);} return anchor; } function create_img(url,title,class_name,is_appendChild,node,refNode){ let img = document.createElement('img'); img.src=url; img.title=title; img.alt=title; img.width=54; if(is_appendChild){ node.appendChild(img); } else{node.insertBefore(img, refNode);} return img; } function create_span(text,class_name,is_appendChild,node,refNode){ var span=document.createElement("span"); span.innerText=text; span.classList.add(class_name); span.style.fontWeight="100"; if(is_appendChild){ node.appendChild(span); } else{node.insertBefore(span, refNode);} return span; } function fn_gm_XMLHttpRequest(url,fn){ GM_xmlhttpRequest({ method: "GET", url: url, headers:{ 'content-type': 'text/html; charset=UTF-8', 'user-agent':window.navigator.userAgent }, onload: function (response){ fn(response); /*console.log([ "GM_xmlhttpRequest", response.status, response.statusText, response.readyState, response.responseHeaders, //response.responseText, response.finalUrl].join("\n") );//*/ } }); } function fn_url(url){ var str_url=new URL(url); var params=new URLSearchParams(str_url.search); return [str_url,params]; } //console.log("break"); function steam_app_id(url){ url=fn_url(url); var host=url[0].host; var pathname=url[0].pathname; var ary_pathname=pathname.split('/'); if(url[0].host=="store.steampowered.com"||url[0].host=="steamdb.info"){ if(ary_pathname[1]=="app")return ary_pathname[2]; } else if(url[0].host=="steamcommunity.com"){ if(ary_pathname[1]=="app")return ary_pathname[2]; if(ary_pathname[3]=="achievements"){//achievements if(!isNaN(ary_pathname[2])){return ary_pathname[2];} else{ var gameLogo_a=document.querySelectorAll('div.gameLogo>a')[0]; if(gameLogo_a!=undefined){return fn_url(gameLogo_a.href)[0].pathname.split('/')[2];} else{return null;} } } if(url[1].get('category_753_Game[]')!=null)return url[1].get('category_753_Game[]').replace(/tag_app_/i, '');//Community Market if(ary_pathname[3]=="753")return parseInt(ary_pathname[4],10);//Community Market item if(ary_pathname[3]=="gamecards")return parseInt(ary_pathname[4],10);//badge } return null; } function fn_re_market_check(response){ let dom=document.createRange().createContextualFragment(response.responseText); if(response.status==200){ if(dom.querySelectorAll('div.market_sortable_column').length==0)is_Community_Items_Exist=false; var anchor=document.querySelectorAll('a.anchor_Items'); for(let i = 0; i < anchor.length; i++){ if(is_Community_Items_Exist){ anchor[i].parentNode.classList.add('link_item'); } else{anchor[i].style.display="none";} } anchor[0].parentNode.classList.add('checked_item'); } else{//451 console.log("market response.status: "+response.status+response.responseHeaders); } } function fn_re_avatar_check(response){ if(response.status==200){ if(response.finalUrl.search(new RegExp("/Avatar/List", "i"))==-1)is_avatar_Exist=false; var anchor=document.querySelectorAll('a.anchor_avatar')[0]; if(is_avatar_Exist){ anchor.parentNode.classList.add('link_avatar'); } else{anchor.style.display="none";} anchor.parentNode.classList.add('checked_avatar'); } else{// console.log("avatar response.status: "+response.status+response.responseHeaders); } } function fn_re_item(response){ let dom=document.createRange().createContextualFragment(response.responseText); var url=fn_url(response.finalUrl); var appid=url[0].search.replace(/\?gamepage-appid-/i, ''); if(response.status==200){ var output=document.querySelectorAll('div.item')[0]; var badge=Array.from(dom.querySelectorAll('div.badge>div>img'));//badge for(let j=0; j<badge.length; j++){ create_img(badge[j].src.replace(akamaihd, steamstatic),'badge','',true,output); } output.appendChild(document.createElement('br')); var ary_img=Array.from(dom.querySelectorAll('div.emoticon>div>img'));//emoticon ary_img=ary_img.concat(Array.from(dom.querySelectorAll('div.background>div>a>img'))); for(let j=0; j<ary_img.length; j++){ if(ary_img[j].src.search(new RegExp("/economy/emoticon", "i"))==-1){ let img_url=ary_img[j].src.replace(akamaihd, steamstatic); create_img(img_url,'','',true,output); } } var ary_animated=Array.from(dom.querySelectorAll('div.avataranimated>div>img.image-animated'));//animated ary_animated=ary_animated.concat(Array.from(dom.querySelectorAll('div.sticker>div>img.image-animated')),Array.from(dom.querySelectorAll('div.animated>div>a>img'))); ary_animated=ary_animated.concat(Array.from(dom.querySelectorAll('div.minibg>div>img')),Array.from(dom.querySelectorAll('div.aframe>div>img.image-animated'))); for(let j=0; j<ary_animated.length; j++){ if(true){ create_img(ary_animated[j].src.replace(akamaihd, steamstatic),'','',true,output); } } console.log("fn_re_item 200"); } else{// console.log("response.status: "+response.status+response.responseHeaders); } } function fn_re_avatar(response){ let dom=document.createRange().createContextualFragment(response.responseText); var url=fn_url(response.finalUrl); if(response.status==200){ var output=document.querySelectorAll('div.item')[0];console.log(response.responseText); var avatarBlockFull=Array.from(dom.querySelectorAll('div#avatarBlockFull>a>img')); for(let j=0; j<avatarBlockFull.length; j++){ output.appendChild(avatarBlockFull[j]); } console.log("fn_re_avatar 200"); } else{// console.log("response.status: "+response.status+response.responseHeaders); } } function main_01(game_meta_data){ var tmp=document.querySelectorAll('div.Community_Items')[0];//old script if(tmp==undefined){ var category_block=document.querySelectorAll('div#category_block')[0]; var div_item_link=create_div("Community_Items",false,game_meta_data[0],category_block); var a_avatar=create_a("Avatar","https://steamcommunity.com/ogg/"+appid+"/Avatar/List","anchor_avatar",true,div_item_link); var a_market=create_a("Community Market","https://steamcommunity.com/market/search?appid=753&category_753_Game[]=tag_app_"+appid+"#p1_name_asc","anchor_Items",true,div_item_link); var a_points=create_a("Points Shop","https://store.steampowered.com/points/shop/app/"+appid,"anchor_Items",true,div_item_link); var a_steamcardexchange=create_a("steamcardexchange","https://www.steamcardexchange.net/index.php?gamepage-appid-"+appid,"anchor_Items",true,div_item_link); var a_steamdb=create_a("steamdb/communityitems","https://steamdb.info/app/"+appid+"/communityitems/","anchor_Items",true,div_item_link); var link_a=div_item_link.querySelectorAll('a'); for(let i=0; i<link_a.length; i++){link_a[i].classList.add('linkbar')} div_item_link.style.backgroundImage="url('https://cdn.cloudflare.steamstatic.com/steam/apps/"+appid+"/page_bg_generated_v6b.jpg')"; div_item_link.classList.add('link_dev'); fn_gm_XMLHttpRequest("https://steamcommunity.com/market/search?appid=753&category_753_Game[]=tag_app_"+appid+"#p1_name_asc",fn_re_market_check); fn_gm_XMLHttpRequest("https://steamcommunity.com/ogg/"+appid+"/Avatar/List",fn_re_avatar_check); } } function main_02(){ var div_Community_item=document.querySelectorAll('div.Community_Items')[0]; if(div_Community_item.classList.contains('checked_item')&&div_Community_item.classList.contains('checked_avatar')){ window.clearInterval(timeoutID); if(div_Community_item.classList.contains('link_item'))fn_gm_XMLHttpRequest("https://www.steamcardexchange.net/index.php?gamepage-appid-"+appid,fn_re_item); //if(div_Community_item.classList.contains('link_avatar'))fn_gm_XMLHttpRequest("https://steamcommunity.com/ogg/"+appid+"/Avatar/List"+appid,fn_re_avatar);//page dont load } } (function(){//main 'use strict'; var url=fn_url(document.location); appid=steam_app_id(document.location)//document.location.host+document.location.pathname+document.location.search+document.location.hash var lang=document.documentElement.lang; console.log("steam: "+appid) if(url[0].host=="store.steampowered.com"){ var game_meta_data=document.querySelectorAll('div.game_meta_data');//steam game page if(game_meta_data.length>0){ window.setTimeout(( () => main_01(game_meta_data) ), 100);//old script var div_item=create_div("item",true,game_meta_data[0]); timeoutID = window.setInterval(( () => main_02()), 1000);//show item image var div_curators=create_div("curators",true,game_meta_data[0]); create_a("curators","https://store.steampowered.com/curators/curatorsreviewing/?appid="+appid,"linkbar",true,div_curators); } if(url[0].pathname=="/curators/curatorsreviewing/"){//steam curatorsreviewing page var page_content=document.querySelectorAll('div.light_container>div.page_content'); var div_lang=create_div("breadcrumbs",false,page_content[0],page_content[0].firstChild); for(let i=0; i<ary_lang_steam.length; i++){ let anchor_lang=create_a(ary_lang_steam[i],"#","lang",true,div_lang); anchor_lang.setAttribute("onclick","ChangeLanguage('"+ary_lang_steam[i]+"'); return false;"); create_span(" / ","breadcrumb_separator",true,div_lang); } } } else if(url[0].host=="steamcommunity.com"){ var div_1=document.querySelectorAll('div.market_search_results_header>div')[0];// if(div_1!=undefined){ create_a(appid,"https://store.steampowered.com/app/"+appid,"market_searchedForTerm",true,div_1); create_a("steamdb","https://steamdb.info/app/"+appid+"/communityitems/","market_searchedForTerm",true,div_1); create_a("steamcardexchange","https://www.steamcardexchange.net/index.php?gamepage-appid-"+appid,"market_searchedForTerm",true,div_1); } var div_2=document.querySelectorAll('div.market_listing_nav')[0];// if(div_2!=undefined){ create_a(appid,"https://store.steampowered.com/app/"+appid,"btn_green_white_innerfade",true,div_2); create_a("steamdb","https://steamdb.info/app/"+appid+"/communityitems/","btn_green_white_innerfade",true,div_2); create_a("steamcardexchange","https://www.steamcardexchange.net/index.php?gamepage-appid-"+appid,"btn_green_white_innerfade",true,div_2); var anchor=document.querySelectorAll('div.market_listing_nav>a'); for(let i=0; i<anchor.length; i++){ if(anchor[i].href.search(new RegExp("category_753_Game", "i"))!=-1){ anchor[i].href+="#p1_name_asc"; break; } } } var div_profile_small_header_text=document.querySelectorAll('div.profile_small_header_text')[0];//profile badge if(div_profile_small_header_text!=undefined){ create_span("💠","profile_small_header_arrow",true,div_profile_small_header_text); create_a("Community Market","https://steamcommunity.com/market/search?appid=753&category_753_Game[]=tag_app_"+appid+"#p1_name_asc","anchor",true,div_profile_small_header_text); } var div_tab=document.querySelectorAll('div#mainContents>div')[0];//achievements if(div_tab!=undefined){ var div_achievements=create_div("tabOff",true,div_tab); create_a("steamdb achievements","https://steamdb.info/app/"+appid+"/stats/","steamdb",true,div_achievements); } } else if(url[0].host=="steamdb.info"){ if(appid!=null){ var app_links=document.querySelectorAll('nav.app-links')[0]; if(app_links!=undefined){ create_a("curators","https://store.steampowered.com/curators/curatorsreviewing/?appid="+appid,"linkbar",true,app_links); } } } else if(url[0].host=="www.steamcardexchange.net"){ var button_blue=document.querySelectorAll('div>a.button-blue'); for(let i=0; i<button_blue.length; i++){ if(button_blue[i].innerText.search(new RegExp("STEAM MARKET", "i"))==0){ button_blue[i].href+="#p1_name_asc"; break; } } } })();