Skip to content

Instantly share code, notes, and snippets.

@wturnerharris
Created January 11, 2014 19:52
Show Gist options
  • Select an option

  • Save wturnerharris/8375866 to your computer and use it in GitHub Desktop.

Select an option

Save wturnerharris/8375866 to your computer and use it in GitHub Desktop.
Remove ad column from DOM in gmail and kill the remaining margin-right css property.
// ==UserScript==
// @name Hide Gmail Ads
// @namespace http://userscripts.org/users/540155
// @description Remove ad column from DOM in gmail and kill the remaining margin-right css property.
// @match https://mail.google.com/
// @include https://mail.google.com/*
// @include https://mail.google.com
// @grant GM_addStyle
// @version 0.1
// @copyright 2014+, You
// ==/UserScript==
function removeAds() {
var y3 = document.getElementsByClassName('y3');
if (y3.length) {
y3[0].remove();
console.log('removed ad panel');
}
}
window.onhashchange = removeAds;
window.setTimeout( removeAds, 5000 );
GM_addStyle('.if{margin-right: 0px !important;}');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment