A Few Favelets

Every so often I’ll receive an email with a link to a file that my browser of choice doesn’t know what to do with. Last weekend I received just such an email. I clicked on the link for a Flash .fla and Safari tried to read it as text. No dice. Since the link was in an email and not the browser I couldn’t option-click or right-click to save the file to disk.

Normally, I crack open BBEdit and quickly code myself a link, preview in the browser and download the file. Time unnecessarily spent. So I finally whipped up a nifty little favelet that prompts you for the file’s url and then creates the link for you. The second scours the current page and creates a list to all embedded or linked media. The third shows the browsers internal view of the document’s source and even reflects changes made by scripting.

These favelets have been tested in Safari and Firefox Mac (feel free to add to that list in the comments below) and are provided strictly on an as is basis. Enjoy:

Previous
Clear Positioned Elements
Next
Shirt Folding
Author
Shaun Inman
Posted
May 15th, 2004 at 12:42 pm
Categories
JavaScript
Comments
027 (Now closed)

027 Comments

001

good job , man, these are NIFTy and GReAT!

Author
Danny Cohen
Posted
May 15th, 2004 9:34 am
002

Also, i really like how the text color and link color use the style sheet of the page, and not a custom one. So it blends in with the page (for most sites).

why do the tags go uppercase?

Author
Danny Cohen
Posted
May 15th, 2004 9:37 am
003

The tag case depends on the browser you’re using. Safari treats the source as uppercase, Firefox keeps the source’s capitalization. Not sure about others.

I just noticed that the View Rendered Source favelet breaks pages with <textarea>s in Firefox. I might fix that. I might not.

Author
Shaun Inman
Posted
May 15th, 2004 9:59 am
004

oooh, nice additions to my growing collection. Do you take requests? Any chance of getting the edit css favelet to work in Safari?

Author
Jon HIcks
Posted
May 15th, 2004 11:25 am
005

Blast you Jon! There goes the afternoon! ;D

Author
Shaun Inman
Posted
May 15th, 2004 11:47 am
006

I use to use this method: “crack open BBEdit and quickly code myself a link, preview in the browser and download the file.”

But, now, I just type in the URL into Google’s search, and click on the part that says: “If the URL is valid, try visiting that web page by clicking on the following link: _____”

But, still… nice job. And, I like the multiple files option.

Author
Christoph
Posted
May 15th, 2004 11:52 am
007

Clever boy!

Author
Shaun Inman
Posted
May 15th, 2004 12:09 pm
008

No luck Jon, after doing some research it seems that Safari doesn’t have very good DOM support when it comes to accessing and modifying stylesheet values. Bummer.

Author
Shaun Inman
Posted
May 15th, 2004 12:55 pm
009

So here’s a question - would it be possible to modify the second favelet to find the real Quicktime movie that’s downloaded when viewing trailers at Apple’s website? ;) (I’ve seen a few tips at the MacOS X Hints website, but most of them involve either external software or command-line hacking - not exactly the most elegant solutions.) In any case, these are awesome as is - thanks for sharing!

Author
Ste Grainer
Posted
May 15th, 2004 6:12 pm
010

Funny you should ask Ste, that was actually what prompted me to develop that second one! It appears that those trailers use some sort of user agent sniffing to make sure that you have the latest version of Quicktime. Obviously, whatever browser you’re using is not the latest version of Quicktime so it fails the test. Drat!

Author
Shaun Inman
Posted
May 15th, 2004 7:10 pm
011

hehe… that was my fla that sent Shaun to the lab. I enjoy making more work for him. Now, where is my coffee?

Author
Jason Santa Maria
Posted
May 15th, 2004 9:01 pm
012

Hrm, the Quicktime plug-in info says that I’m using Quicktime 6.5.1. I thought that was the latest version (nothing newer shows up when I run Software Update). I’ve tested in both Firefox Mac and Safari (1.2) - both of them list the smaller “sniffer” files, but don’t seem to list the actual movie. Do I need to wait until the movie has finished downloading in the browser first?

It works great for sites where the actual movie is embedded, though some files seem to be listed twice. (Now that I think of it, that’s probably a result of the nested embed/object tags, and not a problem with the favelet.)

Author
Ste Grainer
Posted
May 16th, 2004 4:53 am
013

Shaun, thanks for looking. I’d been fiddling myself, but with no luck. Now I know if YOU can’t get it work, I don’t feel quite so bad!

Author
Jon HIcks
Posted
May 16th, 2004 5:01 am
014

Ahhh

Author
Michael Heilemann
Posted
May 16th, 2004 11:16 pm
015

The download prompt is nice, but unneeded in Safari. Simply past any URL into the address bar and hold Option when you hit return and it’ll download it.

It works just like opt-clicking a link. And while we’re at it, holding Command when you hit return on a URL in the address bar will open it in a new tab.

Author
Xian
Posted
May 17th, 2004 2:09 pm
016

Thanks for the info Xian, I knew about Command+Return but I never thought to try Option+Return. Makes perfect sense.

Author
Shaun Inman
Posted
May 17th, 2004 3:05 pm
017

Here is a list of browsers that are commonly used on Windows machines and their support of these favelets:

IE5.5 * Download Prompt - No * List Embedded Media - No * View Rendered Source - No

IE6 * Download Prompt - No * List Embedded Media - No * View Rendered Source - No

MSN Explorer * Download Prompt - No * List Embedded Media - No * View Rendered Source - No

Firefox 0.8 * Download Prompt - Yes * List Embedded Media - Yes * View Rendered Source - Yes

Mozilla 1.6 * Download Prompt - Yes * List Embedded Media - Yes * View Rendered Source - Yes

Opera 7.50 * Download Prompt - No * List Embedded Media - No * View Rendered Source - No

AOL 9.0 * Download Prompt - No * List Embedded Media - No * View Rendered Source - No

Needless to say, Mozilla.org browsers on a PC once again do things right.

Author
Mike Rainey
Posted
May 17th, 2004 4:35 pm
018

Very nice. I’ve been using this little thing I wrote for years now.

Author
ACJ
Posted
May 19th, 2004 7:10 am
019

ACJ, what does it do?

Author
Danny Cohen
Posted
May 19th, 2004 7:51 am
020

thanks for the fav favelets! they work fine in the latest release of Camino as well.

Author
Aias Cienfuegos
Posted
May 19th, 2004 11:27 pm
021

OT: Here’s a new site: Daemonite. Pretty nice; makes use of the IFR ;)

Author
Christoph
Posted
May 20th, 2004 1:14 pm
022

Curious as to why you would try to open a source flash file with a broswer and not Flash itself …(.swf sure… but .fla ?) No wonder Safari tried to read it as text.

Author
Marc
Posted
May 23rd, 2004 12:54 pm
023

because it was a link in an email…

Author
mitch
Posted
May 25th, 2004 6:40 am
024

Hahaha, right! Thanks Mitch. The top secret real answer is that I’m building a Flash authoring environment in Safari using JavaScript favelets. I’m expecting it to be no more buggy than the official authoring environment. I’m calling it The Other Inman Flash Replacement. ;D

Author
Shaun Inman
Posted
May 25th, 2004 7:09 am
025

.swf every where when using the embedded listing on your page….why?…explain the tip :D

Author
hangon
Posted
May 25th, 2004 1:16 pm
026
Author
hangon
Posted
May 25th, 2004 1:27 pm
027

The List embedded media downloader is the fucking best thing ever!!! One major flaw I had with firefox is that it doesn’t store its cache in a way you can easily take quicktime movies from and this solves it! Thanks a million!

Author
John O'Connell
Posted
Jan 9th, 2005 6:58 am