De-ad Facebook

By diego.devita Last update Nov 26, 2008 — Installed 11,606 times.

Suggestions

in
Subscribe to Suggestions 6 posts, 3 voices



diego.devita Script's Author

let's discuss here your suggestions..about everything!

 
Avindra V.G. Scriptwright

Remove function:

remove=function(tagName, attribute, regex) {	
	var nodes = document.getElementsByTagName(tagName), i=-1;	
	while (obj = nodes[i++])
		if (regex.test(obj.getAttribute(attribute))) obj.parentNode.removeChild(obj);
};

?

 
diego.devita Script's Author

for sure it would be more compact, but I don't like to lose clearness. Anyway today I realized I could do a better job using an hybrid approach. So when the pattern is really simple why should I avoid the css styles you suggested before? the selectors let me do what I need in that case. So I divided the script in 2 phases, in the first one it obfuscates the ads overriding the style via css. Then it cleans everything looking for Iframes matching the regular expression.

I'm going to upload last version.

 
Avindra V.G. Scriptwright

Oooh.. not sure if you want to block all iframe's. A lotttt of applications rely on it.

 
diego.devita Script's Author

what I found so far were empty iframes that facebook as a whole needed to work. But if I hide them instead of removing everything keeps working. And all the iframes with visible content seem to be advertisments.

...just while I was writing I forgot that some applications actually use iframes with content, Realm of Empires for example. It's a mess...I have to go back, I really hoped I solved definitely the problem. Now the pattern again, it's a nightmare :)

 
think: User

How about blocking the new Poll's that show up on the news feed?

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel