|
Below is a version that works both in Chrome and FF browsers, feel free to include it in your next release. BR.
var debug = false;
if (!debug) {
var GM_log = function() {};
} else if (unsafeWindow.console) {
var GM_log = unsafeWindow.console.log;
}
GM_log('Yahoo! Mail Cleanup script started');
// remove elements
//removeElementByID('ymail-image');
removeElementByID('theAd');
GM_log('Unneeded elements removed');
// move the search bar
x = document.getElementById("search");
if(x) {
x.style.zIndex='100';
GM_log('Search bar moved');
}
// add custom styles to document
var styles = "\
.col-hd { background-color: #E0E0E0 !important }\
.nav-bar div.tabs { padding-left:0px !important }\
div.nav-bar { top:44px !important; }\
#main { top: 72px !important }\
#uh { height:44px !important }\
#uh div.right { right:15px !important }\
#shellnavigation, #shellcontent { top:107px !important; right:0px !important; }\
#search { position:relative !important; margin-top:30px !important; }\
";
addGlobalStyle(styles);
GM_log('Styles changed');
// remove an element found by ID
function removeElementByID(strId) {
var elem = document.getElementById(strId);
if(elem) {
elem.parentNode.removeChild(elem);
GM_log('Element "' + strId + '" removed.');
} else {
GM_log('WARNING: Element "' + strId + '" not found.');
}
}
function addGlobalStyle(css) {
if(typeof GM_addStyle=='function') {GM_addStyle(css);return}
var style = document.createElement('style').setAttribute('type', 'text/css');
document.getElementsByTagName('head')[0].appendChild(style).innerHTML=css;
}
|