Is my script running? (Problem with URLs, Facebook)

View: New views
2 Messages — Rating Filter:   Alert me  

Is my script running? (Problem with URLs, Facebook)

by bdc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm writing a script to run on facebook.com/home.php, but it doesn't execute under all circumstances, which I find rather bizarre.

I have included http://www.facebook.com/home.php*. When I enter the URL into the address bar the script runs marvelously. When I navigate there by clicking 'home' or on the logo (these URLs are of the form http://www.facebook.com/home.php#/home.php?ref=logo), the script does not run.

There are three possibilities:

1. The problem lies with Facebook. This is most probable. Facebook is so obfuscated with Javascript that it's possible some internal mechanism I don't understand (regarding the way it deals with URLs) is messing with the basic function of the Greasemonkey script. Have you written scripts for Facebook before?

2. The problem lies with Greasemonkey. I doubt this is the case, but if so, has anyone experienced a bug like this before? Is there a fix?

3. The problem lies with me. I don't think this is likely, because the effect still occurs even when the script is shortened to "alert(0)".

Ideas?

Re: Is my script running? (Problem with URLs, Facebook)

by mightythor :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I find that grease monkey is looking for an exact match when deciding whether to execute a script.  Even proper wildcards don't always produce a hit.  With facebook, the workaround seems to be to hit Refresh.  If you are at your home, for example, and the address has a bunch of irrelevant garbage in it, hitting Refresh eliminates the garbage, and the url is re-written to include just http://www.facebook.com/home.php, which will fire your script.