Skip to content

Instantly share code, notes, and snippets.

@m0sa
Last active June 8, 2016 08:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m0sa/79d8c595a3088afa795d to your computer and use it in GitHub Desktop.
Save m0sa/79d8c595a3088afa795d to your computer and use it in GitHub Desktop.
SO Hangouts Authuser Redirect
// ==UserScript==
// @name SO Hangouts Authuser Redirect
// @namespace http://m0sa.net/
// @version 1.1
// @description authuser=1
// @author m0sa
// @include https://plus.google.com/hangouts/_/stackoverflow.com/*
// @include https://hangouts.google.com/hangouts/_/stackoverflow.com/*
// @grant none
// ==/UserScript==
var authuser = 1;
var initial = window.location.href;
var clean = initial.split('#')[0].replace(/[\?&]authuser=\d+/, '');
var updated = clean + (clean.indexOf('?') >=0 ? '&' : '?') + 'authuser=' + authuser + window.location.hash;
if (initial != updated)
{
window.location.href = updated;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment