Create a gist now

Instantly share code, notes, and snippets.

Gmail Domain Replacement - Switcher
// ==UserScript==
// @name Gmail Replace Domain
// @author
// @namespace
// @description example script to alert "Hello world!" on every page
// @include*
// ==/UserScript==
var your_domain = ''; //Your domain to change.
var canvas_frame = document.getElementById('canvas_frame').contentWindow.document; //The Canvas Frame in Gmail
var user_id = canvas_frame.getElementById('guser').getElementsByTagName('b')[0]; //Get the child b element containing username
user_id.innerHTML = user_id.innerHTML.replace('',your_domain); //The actual replacement of the domain takes place here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment