Open in browser extension

Talk about add-ons and extension development.
Sylvain Pasche
Posts: 14
Joined: June 18th, 2006, 8:29 am
Location: Switzerland

Open in browser extension

Post by Sylvain Pasche »

Have you ever been annoyed when you wanted to see a document and the download popup appears which forces you to select an external editor to view it?

This extension allows you to open the document directly in browser. You can also change the mime type of a document being viewed (could be used as a source viewer).

You can download it there:

http://www.spasche.net/mozilla/

There are still some issues I have mentioned on that page, just have a look at the list before posting feedback.

Thanks
toe_head2001
Posts: 10
Joined: December 29th, 2005, 1:07 pm

Post by toe_head2001 »

Thank you for making this. One Question, Does it remember what files extensions should be opened in the browser as?. In other words would it remember that a .LOL should be opened in the browser as a txt file, and a .ROFL should be opened in the browser as a xml file.
Sylvain Pasche
Posts: 14
Joined: June 18th, 2006, 8:29 am
Location: Switzerland

Post by Sylvain Pasche »

toe_head2001 wrote:Thank you for making this. One Question, Does it remember what files extensions should be opened in the browser as?. In other words would it remember that a .LOL should be opened in the browser as a txt file, and a .ROFL should be opened in the browser as a xml file.


Unfortunately not. However, it tries to select the correct mime type if the downloaded file is a known mime type. For instance, if you open http://static.flickr.com/46/138101674_4 ... f5_o_d.jpg the image type will be automatically pre-selected.

This is on the TODO list however.
Zoolcar9
Posts: 2225
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)
Contact:

Post by Zoolcar9 »


Is it possible to change the mime type BEFORE the page is loaded?
Like when you right click on a link and select Open This Link As -> mime types
This will be useful, for example, to open this link as <code>application/x-xpinstall</code>

My Firefox information | Add-ons | GitHub

"With great power, comes great desire to show it off."
Sylvain Pasche
Posts: 14
Joined: June 18th, 2006, 8:29 am
Location: Switzerland

Post by Sylvain Pasche »

Zoolcar9 wrote:
Is it possible to change the mime type BEFORE the page is loaded?
Like when you right click on a link and select Open This Link As -> mime types
This will be useful, for example, to open this link as <code>application/x-xpinstall</code>




Technically, that would not be difficult. However, I think the current implementation covers this use case in some way:

In case the document has a bad mime type (like your above example), the download popup will appear, and you can choose there the mime type you want. When you click "ok", it is reloading the document in the browser window, so you will only have downloaded the document for the time from the click on the URL up to when you choose "ok", so it may not be dowloaded twice.

Then remains the case of documents which have a wrong mime type, but which open in the browser. There I agree that having the open this link as context menu will make you spare some clicks, but you would still have needed to open the page normally to see that it has the wrong mime type in most cases.
d-b
Posts: 11
Joined: April 18th, 2004, 5:21 am

PDF

Post by d-b »

Great extension. Do you think you could add application/pdf to its known MIME-types?
Sylvain Pasche
Posts: 14
Joined: June 18th, 2006, 8:29 am
Location: Switzerland

Re: PDF

Post by Sylvain Pasche »

d-b wrote:Great extension. Do you think you could add application/pdf to its known MIME-types?


Added to the TODO list. Maybe the best option would be to make the list configurable.
rdtennent
Posts: 2
Joined: August 13th, 2003, 6:34 am

Post by rdtennent »

This doesn't work for me (1.5.0.6 on Linux). After selecting "Open in Browser as Text" I just get the same dialog back again. Any ideas why?
Sylvain Pasche
Posts: 14
Joined: June 18th, 2006, 8:29 am
Location: Switzerland

Post by Sylvain Pasche »

rdtennent wrote:This doesn't work for me (1.5.0.6 on Linux). After selecting "Open in Browser as Text" I just get the same dialog back again. Any ideas why?


Actually, it does not work with some protocols, like file:/// or ftp:///. Is it broken for all http:/// URL's? I have sometimes seen some http:// URL's where it does not work, but I didn't understand what was the problem.
Stanimir Stamenkov
Posts: 18
Joined: September 7th, 2006, 11:30 am

Re: Open in browser extension

Post by Stanimir Stamenkov »

Could it be made available for SeaMonkey 1.0 or 1.1?
useSVGnotSWF
Posts: 27
Joined: June 10th, 2006, 12:14 am

Post by useSVGnotSWF »

This is excellent for sites that host content for you but never get around to correctly configuring their webservers. I've been waiting months for sitesled to fix the SVG mimetype, now it's just a matter of View -> View as -> XML for urls like http://mardeg.sitesled.com/elementspiral.svg

Is it possible to add the ability to emulate the Content-Encoding line?
For .svgz files the "view as XML" won't work because the line:

Content-Encoding: gzip

is obviously missing from the webserver for http://mardeg.sitesled.com/elementspiral.svgz but to make matters worse Firefox cannot view .svgz files locally saved unless they are manually extracted first. A time-wasting inconvenience that defeats the benefit of time-saving for bandwidth as intended by compression.
Could this extension be further enhanced to include the option for adding a line like this?
fahlmanc
Posts: 281
Joined: June 13th, 2005, 6:48 pm
Location: Victoria

Post by fahlmanc »

The extension now doesn't work with bon-echo. Gecko/20061122 BonEcho/2.0.0.1pre
Stanimir Stamenkov
Posts: 18
Joined: September 7th, 2006, 11:30 am

Re: Open in browser extension

Post by Stanimir Stamenkov »

Following the "How to hack extensions to make them compatible with SeaMonkey" [1] tutorial I've been able to make it install and work in my SeaMonkey.

[1] http://users.skynet.be/fa258499/hackexttutorial.html
User avatar
Philip Chee
Posts: 6475
Joined: March 1st, 2005, 3:03 pm
Contact:

Re: Open in browser extension

Post by Philip Chee »

stanio wrote:Following the "How to hack extensions to make them compatible with SeaMonkey" [1] tutorial I've been able to make it install and work in my SeaMonkey.

[1] http://users.skynet.be/fa258499/hackexttutorial.html
Great! Could you email it to BenoitRen so that he can put it up on his seamonkey-ported extensions page, or at least a download link for his list of SeaMonkey compatible extensions. Thanks.

Phil
Stanimir Stamenkov
Posts: 18
Joined: September 7th, 2006, 11:30 am

Re: Open in browser extension

Post by Stanimir Stamenkov »

Philip Chee wrote:Could you email it to BenoitRen so that he can put it up on his seamonkey-ported extensions page, or at least a download link for his list of SeaMonkey compatible extensions.

Seems I can't find the email address of BenoitRen. :?
Post Reply