 |
|
// ==UserScript==
// @name Ad Slicer for MySpace
// @namespace http://www.myspace.com/adrian232
// @include http://myspace.com.r{}*.myspace.com.r{}*
// @exclude http://deSK.myspace.com.r{}* // These are handled below
remove = document·getElementById('ctl00_Main_ctl00_CMS_ProfileHome_gads');
if (remove) destroy(remove);
remove = document·getElementById('ctl00_Main_ctl00_CMS_ProfileHome_Gads_A');
if (remove) destroy(remove);
remove = document·getElementById('ctl00_Main_ctl00_CMS_ProfileHome_Gads');
if (remove) destroy(remove);
remove = document·getElementById('ctl00_Main_ctl00_ProfileHome_gads');
if (remove) destroy(remove);
*/
// resize a few things, just in case it gets stuck
topnav = document·getElementById('topnav');
header = document·getElementById('header');
if (header) header.style['height'] = '40px';
modify = document·getElementById('home_infoBar');
if (modify) modify.style['width'] = '94%';
modify = document·getElementById('header_search');
if (modify) {
modify.style['backgroundImage'] = 'none';
modify.style['backgroundColor'] = 'transparent';
modify.style['marginLeft'] = '200px';
modify.style['marginTop'] = '-2em';
//modify.style['width'] = 'auto';
}
for (var y = 0; y < images.length; y++) {
if (images[y].parentNode && (images[y].className == 'googleLogo' || images[y].getAttribute('alt') == 'Powered by Google')) {
var google = images[y].parentNode;
.r{}
destroy(google);
//google.style['marginTop'] = '-54px';
//googlw.style['marginLeft'] = '54px';
}
}
.r{}
.r{}
// loop thru all SCRIPT tags that load ads
for (var y = 0; y ..s.length; y++) {
var t = scripts[y];
var n = scripts[y].nextSibling;
// skip over text nodes
//for (n = scripts[y].nextSibling; n && n.nodeName == "#text"; n = n.nextSibling);
//t.className = "1"; // debug
.r{}* 1) .. src="blahblah.js">..> (this one has src defined)
* 2) ..> some.javascript.here(); ..> (this one doesn't)
*
* And then there are Google ads:
* 3) .. src="http://pagead[0-9].googlesyndication.com/...">..>
*/
// ignore any of type 2 that don't contain the oas_ad() function
if (!t.src && !t.text.match(/oas_ad..(/))
continue;
//t.className = "2"; // debug
// ignore all valid myspace scripts
if (t.src.match(/x...myspace...com/) ||
t.src.match(/cache...static...userplane...com/) || // chat script
t.src.match(/../WebResource.axd/)
)
continue;
//t.className = "3"; // debug
// if the next sibling is a script, then stop here
if (!n || n.nodeName == "SCRIPT")
continue;
//t.className = "4"; // debug
// destroy the next sibling
destroy(n);
destroyParent(t);
//t.className = "5"; // debug
}
for (var y = 0; y < divs.length; y++)
if (divs[y].id && divs[y].id.match(/_[gG]ads/))
destroy(divs[y]);
// the "advertisement" image is a dead giveaway
for (var y = 0; y < images.length; y++) {
if (images[y].src.match(/advertisement/)) {
destroyParent(images[y]);
destroy(images[y]);
}
}
// destroy all frames, JIC
for (var y = 0; y ..s.length; y++)
destroy(frames[y]);
// un-hide special nodes
for (y = 0; y < tables.length; y++) {
var t = tables[y];
if (t.className == "sidenav") { // for the side navbar in mail
for (var p = t.parentNode; p; p = p.parentNode) {
if (p.nodeName == "TABLE") {
unhide(p);
unhide(p.parentNode);
if (p.previousSibling) // the blank table before it, too
unhide(p.previousSibling.previousSibling);
break;
}
}
}
}
// destroy the parent node
function destroyParent(node) {
var p = node.parentNode;
if (p&& p.id != "content" && // exclusions JIC
p.id != "contentWrap" &&
p.id != "main" &&
p.id != "body" &&
p.id != "nav" &&
p.id != "blog_content" &&
p.id != "groupsnarrowleft" &&
p.id != "books_skinny" &&
p.id != "aspnetForm" && // form for picture comments
p.nodeName != "BODY" && // don't destroy the BODY tag
p.parentNode && // or any child of the BODY
p.parentNode.nodeName != "BODY" &&
p.parentNode.nodeName.id != "body")
destroy(p);
}
// destroy the node and all its children
function destroy(node) {
for (var y = 0; y < node.childNodes.length; y++) {
var p = node.childNodes[y];
if (p.style)
p.style['display'] = 'none';
}
if (node.style)
node.style['display'] = 'none';
}
function unhide(node) {
if (node && node.style) {
if (node.nodeName == "TABLE")
node.style['display'] = 'table';
else if (node.nodeName == "TD")
node.style['display'] = 'table-cell';
else if (node.nodeName == "TR")
node.style['display'] = 'table-row';
else
node.style['display'] = 'block';
}
}
})();
|
Who I'd like to meet:
|
|
|
| Lukalicious's Friend Space (Top 13) |
|
Lukalicious has 122 friends.
|
|
|
|
|
|
|