Skip to content

Instantly share code, notes, and snippets.

@MalikAQayum
Last active November 21, 2022 00:07
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save MalikAQayum/237ca9687512c50fd1c87e16f7c89c3c to your computer and use it in GitHub Desktop.
Save MalikAQayum/237ca9687512c50fd1c87e16f7c89c3c to your computer and use it in GitHub Desktop.
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