GAMES4U.ORG Quick Access Button for Steam

Instantly access GAMES4U.ORG for game-related information and resources directly from Steam's purchase section.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         GAMES4U.ORG Quick Access Button for Steam
// @version      1.0
// @description  Instantly access GAMES4U.ORG for game-related information and resources directly from Steam's purchase section.
// @match        https://store.steampowered.com/app/*
// @icon         https://www.google.com/s2/favicons?domain=steampowered.com
// @grant        GM_xmlhttpRequest
// @homepageURL https://greasyfork.org/en/scripts/511589-games4u-org-quick-access-button-for-steam
// @namespace https://greasyfork.org/users/1290286
// ==/UserScript==

(() => {
    'use strict';

    const headerEl = document.querySelector('.apphub_HeaderStandardTop');
    if (!headerEl) return;

    let itemID = window.location.pathname.split('/')[2];
    let games4uUrl = `https://games4u.org/?s=${itemID}`;

    let el = document.createElement('div');
    el.classList.add('apphub_OtherSiteInfo');
    el.style['margin-left'] = '1rem';

    el.innerHTML = `
    <a class="btnv6_blue_hoverfade btn_medium" href="${games4uUrl}" target="_blank">
        <span>View on GAMES4U.ORG</span>
    </a>
    `;

    const existingEl = document.querySelector('.apphub_OtherSiteInfo');
    if (existingEl) {
        headerEl.insertBefore(el, existingEl);
    } else {
        headerEl.appendChild(el);
    }

})();