After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 81615 - nautilus .html files are shown in text format.
nautilus .html files are shown in text format.
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: [obsolete] Views: Web Page
0.x.x [obsolete]
Other Solaris
: High normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 81083 84000 85238 (view as bug list)
Depends on:
Blocks: 78394 79136
 
 
Reported: 2002-05-13 08:26 UTC by Kalpesh Shah
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to run a web browser for html files by default, rather than use the text component (944 bytes, patch)
2002-05-14 20:28 UTC, Damon Chaplin
none Details | Review

Description Kalpesh Shah 2002-05-13 08:26:28 UTC
Using Build of 10th may.

Logging in as new user in Gnome 2.0
 
If you try to open a local .html file in nautilus, it opens 
up that file as a text file. i.e. it would show <head> 
<body> kind of stuff too.

Is it possible to make "gtkhtml" as default application 
to open html pages in nautilus.
Comment 1 Dave Bordoley [Not Reading Bug Mail] 2002-05-13 13:22:52 UTC
*** Bug 81083 has been marked as a duplicate of this bug. ***
Comment 2 Dave Bordoley [Not Reading Bug Mail] 2002-05-13 13:24:46 UTC
I'm not sure if this change was done on purpose or not, but personally
considering the buggyness of gtkhml in general and the gtkhtml view, I
actually prefer that nautilus doesn't use this as the default view.
Pehaps the gtkhtml view shouldn't even ship, since it's even not
maintained i believe.
Comment 3 Luis Villa 2002-05-13 13:34:16 UTC
Damon: can you take a look at this ASAP? Thanks. Sun considers it very
important (though I, personally, tend to agree with Dave that that's
what a web browser is for :) 
Comment 4 Damon Chaplin 2002-05-13 16:57:55 UTC
Do you have the nautilus-gtkhtml component installed?
It is a separate module in cvs, and is an optional part of Nautilus.

I have it installed and can view html files just fine.
Comment 5 Luis Villa 2002-05-13 17:08:41 UTC
Damon: does it default to viewing .html files as html? Trying this
here crashes everything :/
Comment 6 John Sheehan 2002-05-13 17:19:35 UTC
Agree that this is the purpose of a fully-fledged browser.
What seems incorrect is that html files are opened as text
files by default, with the option to "view as GtkHTML" (which
is meaningless to most users).  It is also a poor option to
provide to users if everyone is agreed that GtkHTML is buggy
and can't adequately follow links in the html file (such as
external web pages with cgi or javascript, or mailtos)

It would be better to (in the absence of Mozilla on gtk2):
  - remove all pretensions of browsing from Nautilus (including
    not allowing http:// to be typed in the location bar)
  - remove GtkHTML as a viewer
  - set the mime types for html files to invoke a proper browser.

Comment 7 Dave Bordoley [Not Reading Bug Mail] 2002-05-13 18:07:30 UTC
Well I agree with john, nautilus-gtkhtml2 should not ship with gnome2
however, this is not a nautilus issue as gtkhtml2 isn't maintained by
nautilus, it's part of the unmaintained gtkhtml2 package :)

One problem with not allowing http:// urls is i believe nautilus uses
these for webdav (please correct me if i'm wrong)

Comment 8 Damon Chaplin 2002-05-13 19:28:12 UTC
Oh yes, I had to set up the 'View As' options to get it to use
nautilus-gtkhtml by default. I agree nautilus-gtkhtml shouldn't be the
default view, and it isn't so that is OK.


So we should invoke a web browser to view HTML pages.
I think Nautilus uses the Gnome MIME types as well as its own
configuration settings for which views to show/use, so it may be a
little complicated.

Hopefully Alex knows how to fix it ;)

Comment 9 Alexander Larsson 2002-05-13 19:53:00 UTC
I don't know if we can set launch an external browser when viewing
uri's like that. I'm not sure how this works.
Comment 10 Damon Chaplin 2002-05-13 21:05:37 UTC
I've tried changing the default_action_type to application, in the
MIME types file, but that doesn't seem to be working yet.

(the MIME file is installed into $prefix/share/mime-info/gnome-vfs.keys
look for the text/html entry.)

I was hoping that it would use one of the default web views instead
(mozilla,netscape,galeon). But it still used the text view component.
Comment 11 jacob berkman 2002-05-14 20:11:17 UTC
if i right click on an html file, then go to open with -> other
application... then select galeon, and choose edit, and select "use as
default for html files" then done, then double click on the html file,
it works fine.

so you need to tweak the defaults in
gnome-mime-data/gnome-vfs.applications to do what you want.
Comment 12 Damon Chaplin 2002-05-14 20:15:17 UTC
Ah, the above change does seem to work. I had some user-settings
in ~/.gnome/mime-info that were overriding the defaults.

So we just need to change the 'default_action_type' to 'application'.

I'll just recheck that and then add a patch.
Comment 13 Damon Chaplin 2002-05-14 20:28:44 UTC
Created attachment 8472 [details] [review]
Patch to run a web browser for html files by default, rather than use the text component
Comment 14 dwatson 2002-05-15 16:12:18 UTC
IMO this patch should be reverted once we have a functioning html view.
Comment 15 jacob berkman 2002-05-16 19:45:50 UTC
damon - your patch looks decently ok.

however, i'd like to go a step further in this, and make the 'default
applications properties' configure the gnome-vfs html handler (see bug
#71632, bug #78037).

i have the 'default editor' now setting the mime types stuff - porting
the browser tab to this would be trivial.

if you want, you can hand this bug off to me, and i'd include your
patch with that.
Comment 16 Luis Villa 2002-05-22 22:48:27 UTC
Damon, Jacob: have you discussed this further?
Comment 17 Damon Chaplin 2002-05-23 21:17:27 UTC
Alex was looking into writing a component based on gtkhtml, but it isn't
ready yet.

The plan now is to:

 o Update gnome-vfs so if there are no components available it will use
   an application.
 o Remove the text component from the text/html .keys section.

This way it will still work with GNOME 1.4 / Nautilus 1.4, i.e. the
mozilla component will still be the default. And for GNOME 2 we'll be
using a web browser for now.

I'll look into fixing this.
Comment 18 jacob berkman 2002-05-24 14:27:17 UTC
taking myself off as damon's working on this
Comment 19 mike 2002-05-29 14:27:50 UTC
Just noticed this thread - some comments

IMO nautilus-gtkhtml-2 works just right as a webpage VIEWER
ie: it loads quickly and just shows the web-page

So I would be concerned if it was removed.

Personally I like the current behaviour where a page loads in gtkhtml 
quickly with buttons offering open in galeon,mozilla etc

(although last I looked the galeon selection seemed borked)
Comment 20 Dave Bordoley [Not Reading Bug Mail] 2002-05-29 14:44:04 UTC
My only complaint about including nautilus-gtkhtml2 is that it is
buggy and unmaintained. Basically this leads to a lot of crasher bugs
that no one looks at. I don't think we should be shipping really
borked code for functionality that is well covered by other programs ,
ie mozilla. Anyway i think once galeon2 is released that
nautilus-gtkhtml2 should be dropped all together. If people want to
use a web view in nautilus it should be galeon. Since the galeon view
will be well maintained a featureful.

Comment 21 Damon Chaplin 2002-06-04 19:13:43 UTC
So I had a look at this and removing the text component from the list
of components has no effect. It will also search for components that can
handle text/* and will still find the text component.

So we are now back to my patch above (8472) that changes the default
action to 'application'. Alex has approved this, but we are now frozen,
so I can't commit it yet.
Comment 22 Dave Bordoley [Not Reading Bug Mail] 2002-06-07 05:30:30 UTC
*** Bug 84000 has been marked as a duplicate of this bug. ***
Comment 23 Miles Lane 2002-06-24 07:34:05 UTC
jacob, about your comment on 2002-05-14 16:11:

I cannot reproduce this with my build today.
I have an HTML desktop entry that contains:

[Desktop Entry] Version=1 Encoding=UTF-8 Name=PT-1.html Type=Link
URL=http://www.ibiblio.org/Bahai/Texts/EN/PT/PT-1.html
Name[en_US]=Paris Talks.html

I right-click on the icon, Open with --> An Application -> Yes.
In "Program to run", I put mozilla.  I don't see the "Edit"
option either in the "Edit file type" dialog or in the 
icon's context menu.  I don't see a place to set the default
HTML handler.

Hmm.  On further exploration, it looks like you must have been
tweaking this stuff by opening a HTML file within a Nautilus
window, rather than through the desktop UI.  This points up
some usability problems.  There isn't consistency between
the options that are accessible from the desktop and the 
Nautilus windows.

Still, through the Nautilus window, I open my Desktop directory,
and open the HTML pointer.  This shows
http://www.ibiblio.org/Bahai/Texts/EN/PT/PT-1.html in the location
bar and has GtkHTML in the "View as" selection.  This is happening,
even though in "View as" dialog I have removed "View as GtkHTML" and
"View as Text" from the menu.  Also, in the "View as" -> "Go there"
-> "Edit file type" dialog, I selected Mozilla as the default
action.  Clicking on that desktop link still opens the web site
with GtkHTML.  The "Program to run" inputbox is disabled, so I am
left with only the options listed in "Default action."

Okay, I see that if I click on a "real" HTML file, rather than a
URL link dragged from Mozilla onto the desktop, it now opens
Mozilla.  Is there a way for me to also get these URL shortcuts
to work?

I agree that if a real browser is present, we should not display
HTML inside of a Nautilus window.  At least, not unless there is
a working mozilla embedded rendering engine.
Comment 24 Luis Villa 2002-06-27 17:15:06 UTC
*** Bug 85238 has been marked as a duplicate of this bug. ***
Comment 25 Damon Chaplin 2002-06-28 18:52:08 UTC
I've applied my patch to change the default action to application.

Miles: you might want to open other bugs for your specific problems.
There does seem to be some inconsistency there.