public

Gmail Domain Replacement - Switcher

  • Download Gist
Domain Replacement for Gmail.user.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11
// ==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.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.