Redirect Google steam search and steam.com to Steam chat
// ==UserScript==
// @name Steam Redirector
// @namespace steam-redirector
// @version 1.0
// @description Redirect Google steam search and steam.com to Steam chat
// @match *://*.google.com/search*
// @match *://steam.com/*
// @match *://www.steam.com/*
// @match *://*.steam.com/*
// @run-at document-start
// ==/UserScript==
(function () {
'use strict';
const TARGET = "https://steamcommunity.com/chat/";
const url = location.href;
// Google search redirect
if (/google\.com\/search\?q=steam/i.test(url)) {
location.replace(TARGET);
return;
}
// Steam domain redirect (but not steamcommunity to avoid loops)
if (/(\.|^)steam\.com/i.test(location.hostname) && !/steamcommunity\.com/i.test(location.hostname)) {
location.replace(TARGET);
return;
}
})();