Skip to content

Instantly share code, notes, and snippets.

@codejoust
Created October 17, 2009 04:20
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 codejoust/212241 to your computer and use it in GitHub Desktop.
Save codejoust/212241 to your computer and use it in GitHub Desktop.
Gmail Domain Replacement - Switcher
// ==UserScript==
// @name Gmail Replace Domain
// @author http://codejoust.com
// @namespace http://mail.google.com/
// @description example script to alert "Hello world!" on every page
// @include http://mail.google.com/*
// ==/UserScript==
var your_domain = 'yourdomain.com'; //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('gmail.com',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