facebook Photo Theater Killer

By djharvey Last update Feb 18, 2011 — Installed 103,019 times.

Good start but needs another piece to the puzzle...

in
Subscribe to Good start but needs another piece to the puzzle... 16 posts, 4 voices



spinjector User
FirefoxWindows

Your script is great; I wouldn't have had the programming nads to go about it that way. There are a lot of theatermode-related scripts in the HTML that would take days to wade through.

I've found your script only works when I am already in a photo album browsing next & previous through the pictures.

There is one important piece to the puzzle that I found with HttpFox: when you click on a link for a picture, the requested HTTP Get command appends the parameter "&theater" to the end of the requested URL.

This &theater parameter is obfuscated and does does not appear in the Firefox status bar when the mouse hovers over the picture link, or it is added by the scripts on the page. The &theater parameter needs to be removed from the HTTP GET command before it's sent to the Facebook web server to prevent the page that gets sent from opening in theater mode.

My programming skills are really rusty and I'm just learning Greasemonkey, so I don't know when I will be able to do this myself. Perhaps you will get to it first. =-)

 
djharvey Script's Author
ChromeWindows

Hmmmmmmm. So you're saying it doesn't work, say, from a thumbnail in the stream, for instance? It does work for me, but I'm using Chrome and Tampermonkey. Also, the way that the "theater" parameter gets appended for me, it seems to merely add it to the address without actually setting the location of the page. I never did figure out how it was doing it, but it was late, and I wasn't thinking terribly clearly. :-)

 
djharvey Script's Author
ChromeWindows

OK, I just made a fix to the code to account for the bookmark loading that facebook occasionally does to avoid loading the entire page. I don't know if that would fix your issue or not, but you might try getting the latest script code.

 
p113fd User
ChromeWindows

I have a couple things to add that I'm hoping will give you another avenue or two from which to attack.

#1, the photo theater clearly seems to be based on Lightbox by Lokesh Dhakar, from many years ago. I actually had a tiny hand in helping with one tiny part, but I was familiar enough with it to remember that the "rel" tags on each anchor played a crucial part. I created my own script that simply changes all anchors' rel tags to "bob" instead of "theater". It works fine in FF but not in Chrome for some reason probably related to Facebook's ajaxy non-reload reloading. Super simple hack, but I wouldn't be here looking for ideas if it worked ideally... (me love Chrome)

#2, when you first go onto Facebook, use the following URL : https://www.facebook.com/home.php?sk=lf
When you then view a photo, the new photo viewer will flash up on screen for a split second, and will then revert back to the old one WITHOUT YOU HAVING TO DO ANYTHING. I also lack the programming nads to find whatever hooks that is pulling, but it seems relevant :)

 
djharvey Script's Author
ChromeWindows

Regarding #1, good point. I may change up my script to look first for the rel instead of the className, as that would be a surefire way to catch it. I'll try to do that closer to the weekend.
Regarding #2, I have a feeling that they haven't launched the script on their secure site. Just a guess, though.

 
djharvey Script's Author
ChromeWindows

In the latest version, I have it checking based on the rel attributes, so thank you for helping with that particular thought process. :-)

 
Preno User
ieWindows

Great work, djharvey. But it would be possible to be got a plus option to the script? For example if I click on a picture, the script load it on a new tab with full size.

 
djharvey Script's Author
ChromeWindows

You mean where it would open all images in a new window/tab?

 
djharvey Script's Author
ChromeWindows

So, you mean you want the option for albums to open in a new window? That shouldn't be too difficult to add as an option, though you do realize that you can do that currently in most browsers with a ctrl-click or a shift-click. :-)

 
djharvey Script's Author
ChromeWindows

That is to say, you can do it without need of a script at all.

 
Preno User
ieWindows

I give up. :)
So you say if you press the CTRL button and click the picture, the Facebook will open the http://hphotos-ash1.fbcdn.net/175684_1937966706... and don't load the http://www.facebook.com/photo.php?fbid=19379667... page? :)

 
djharvey Script's Author
ChromeWindows

Ahhhhh. I think I've got it now; you want the link to open the image file itself in a new window, sans any kind of HTML, say, instead of going to the next photo, as it does by default? (Do correct me if I'm wrong though. Don't give up, though; just making sure I understand.)

I suppose it's possible, though I'd probably put it in a different script.

 
Preno User
ieWindows

Correct. :)
I just want to open the image file in original size. Without any HTML. I think it would be a very useful function.

 
djharvey Script's Author
ChromeWindows

So, you mean the high-res version, then, if available, or just the regular size if not? You wouldn't want it as a separate link, instead of the image link itself? Only reason I ask is that, knowing how I use it, I almost never use the next link; I generally click the photo to advance.

 
djharvey Script's Author
ChromeWindows

After musing about it a bit, I don't know how doable it actually is for it to view the high-res version, since, by default, it sets the content-disposition on the image to "attachment," which pretty much forces the browser to download the image instead of viewing it. Now, of course, you can have it load it into HTML, which would force the image to be viewed. The only thing is that it wouldn't do any automatic resizing. I also am not sure if most browsers' security features would actually allow me to create said HTML on the fly. I guess I'll have to muse about it some more.

 
Preno User
ieWindows

I'm not sure it's possible. I don't know the javascript language. But I can view images with 2-3 clicks at now. It's a bit complicated.
It's enough, if you redirect the link to the image. I'll set the Firefox to the JPEG images. I think it can work.