Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
adds the ability to send a message to someone that is not your friend, through the "more" button on the steam profile.
// ==UserScript==
// @name Steam Send a Message
// @namespace MalikQayum
// @version 0.3
// @description adds the ability to send a message to someone that is not your friend, through the "more" button on the steam profile.
// @author MalikQayum
// @include /^https?://steamcommunity\.com/(id|profiles)/*/
// @grant none
// ==/UserScript==
if ( $J( "#btn_add_friend" ).length || $J( "#btn_accept_friend" ).length ) {
var container = document.querySelector( '.popup_body.popup_menu.shadow_content' ),
url = "javascript:OpenFriendChat( '"+g_rgProfileData.steamid+"', 0 );",
image,
element;
if( container )
{
image = document.createElement( 'img' );
image.className = '.popup_menu_item';
image.src = 'https://steamcommunity-a.akamaihd.net/public/images/skin_1/icon_btn_comment.png';
element = document.createElement( 'a' );
element.href = url;
element.className = 'popup_menu_item';
element.appendChild( image );
element.appendChild( document.createTextNode( '\u00a0 Send a Message' ) );
container.insertBefore( element, null );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment