Skip to content

Commit

Permalink
Create script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
rdavydov authored Sep 17, 2022
1 parent 4486e3d commit fe68c12
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
sk a question, post a review, or report the script.
// ==UserScript==
// @name Highlight specific friends who play
// @match https://steamcommunity.com/id/*/friendsthatplay/*
// @match https://store.steampowered.com/app/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=steampowered.com
// @author rdavydov
// @description Highlights specific friends on the "who play" page and on the store page
// @license MIT
// @version 0.0.1.20220829135439
// @namespace https://greasyfork.org/users/952134
// ==/UserScript==

// var instead of let because violentmonkey throws warnings :)

////////////////////////////////////////////////////////////////////////////////////////
// Add links to your friends' profiles (without a slash at the end), separated by commas
// Each link should be surrounded with apostrophes ('), see the example below //////////
////////////////////////////////////////////////////////////////////////////////////////
var friends = ['https://steamcommunity.com/id/gabelogannewell','https://steamcommunity.com/id/gaben'];
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
////////////////////////////////////////////////////////////////////////////////////////

document.querySelectorAll('.friendBlockLinkOverlay').forEach(function(element, index) {
if (friends.indexOf(element.href) >= 0) {
document.querySelectorAll('.friendBlockLinkOverlay')[index].style.background = 'rgba(0, 255, 0, 0.20)';
}
});

document.querySelectorAll('.friend_blocks_grid a').forEach(function(element, index) {
if (friends.indexOf(element.href.slice(0,-1)) >= 0) {
document.querySelectorAll('.friend_blocks_grid a')[index].style.background = 'green';
}
});

0 comments on commit fe68c12

Please sign in to comment.