facebook.com - external apps blocker

By reeloo Last update Oct 18, 2009 — Installed 12,510 times.

This is NOT working :(

in
Subscribe to This is NOT working :( 8 posts, 3 voices



Jangly Mark User

I have Greasemonkey installed and enabled.

I added this script - and it appears to do nothing - I'm still getting quiz spam - nothing is being hidden.

How do I make this work?

 
reeloo Script's Author

Hello there,
i can't see any problem. Try to open Your homepage anew.
Cheers!

 
Jangly Mark User

Tried that - still nothing :(

 
reeloo Script's Author

Can You name Your browser etc.?
Eventually, use: http://www.reeloo.net/app/all_about_you/

 
ShaggyTDawg User
FirefoxWindows

There must have been some sort of change in how facebook names its elements. Your code is looking for elements w/ the class of "UIIntentionalStory_Body". However that class doesn't show up in the code for my news feed anymore.

I'm running the latest version of Firefox and using greasemonkey. I doubt any of that matters in this case.

I'm working on identifying what class name should be sought after now.

 
ShaggyTDawg User
FirefoxWindows

I've made it work for my stream by rewriting the remove_external_stories() function. I've modified two lines, the getElementsByClassName and the if (stories[i].innerHTML.indexOf("apps.facebook.com") >= 0) line.

Enjoy!

//removes all external stories
function remove_external_stories(){
var stories = document.getElementsByClassName("UIStoryAttachment");
var count = stories.length;
//goes through all stories
for (var i = count - 1; i >= 0; i--){
if (stories[i].innerHTML.indexOf("apps.facebook.com") >= 0){
//hides the element
stories[i].parentNode.style.display = "none";
}
}
}

 
ShaggyTDawg User
FirefoxWindows

maybe better formatted:

//removes all external stories
function remove_external_stories(){
	var stories = document.getElementsByClassName("UIStoryAttachment");
	var count = stories.length;
	//goes through all stories
	for (var i = count - 1; i >= 0; i--){
		if (stories[i].innerHTML.indexOf("apps.facebook.com") >= 0){
			//hides the element
			stories[i].parentNode.style.display = "none";
		}
	}
}

 
reeloo Script's Author
FirefoxX11

First of all thank You for echo.
I've rewrited the script completely - it's now able to handle even "Ajax redirects".

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