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 513837 - downloaded pdf files are not automatically opened
downloaded pdf files are not automatically opened
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: General
2.22.x
Other All
: Normal normal
: gnome-2-22
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-02-02 06:36 UTC by asubedi
Modified: 2009-01-18 10:01 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22



Description asubedi 2008-02-02 06:36:03 UTC
Please describe the problem:
Epiphany used to open downloaded files automatically (when that option was enabled). Now it does not do that. 

Steps to reproduce:
1. Try to click on a link to a pdf file.


Actual results:
The downloaded file just sits on downloads folder.

Expected results:
The file would be opened in evince.

Does this happen every time?
Yes.

Other information:
Comment 1 Cosimo Cecchi 2008-02-02 09:15:26 UTC
Automatic PDF opening work great here with SVN trunk. Which version of Epiphany, GLib and Evince are you using? Are you sure Evince on its own does work properly?
Comment 2 asubedi 2008-02-03 04:21:50 UTC
Then this may be a fault in Ubuntu. It's also reported in launchpad:

https://bugs.launchpad.net/epiphany-browser/+bug/181128

I am using Epiphany 2.21.90, Glib 2.15.4 and Evince 2.21.90. From the Ubuntu bug, this version of Epiphany uses xulrunner.
Comment 3 Christian Persch 2008-02-03 13:51:48 UTC
Naturally. This is because the code in MozDownload.cpp is #ifndef HAVE_GECKO_1_9 since it's not ported to 1.9 yet.
Comment 4 Reinout van Schouwen 2008-02-04 00:23:10 UTC
@chpe, I presume you meant to target 2.22?
Comment 5 Christian Persch 2008-02-04 18:45:50 UTC
Yes.
Comment 6 asubedi 2008-03-11 21:19:10 UTC
I am wondering when this will be fixed. The about dialog tells me that I am using Epiphany version 2.22.0 powered by gecko 1.9. 
Comment 7 Christian Persch 2008-03-14 16:30:16 UTC
Fixed in svn trunk.
Comment 8 Alexander van Loon 2008-03-23 10:06:54 UTC
So this fix was implemented after the the GNOME 2.22.0 release? Does that mean we will see the fix included in the GNOME 2.22.1 release due 9 April?
Comment 9 Reinout van Schouwen 2008-03-23 23:43:46 UTC
@chpe, it looks like this was committed to trunk only while this bug is targeted for 2.22. Compare:

http://svn.gnome.org/viewvc/epiphany/trunk/embed/mozilla/MozDownload.cpp?view=log

http://svn.gnome.org/viewvc/epiphany/branches/gnome-2-22/embed/mozilla/MozDownload.cpp?view=log
Comment 10 Michael Gratton 2008-04-09 04:23:49 UTC
Hmm, I'm now running 2.22.1.1 and this problem still exists.
Comment 11 Christian Persch 2008-04-09 10:33:10 UTC
Got a test URL ?
Comment 12 Michael Gratton 2008-04-09 10:47:15 UTC
Edit > Preferences > General > Check "Automatically open downloaded files"

Click: http://web.vee.net/tmp/test.pdf

The file gets downloaded and saved, but not opened in Evince.

This is on Ubuntu Hardy:
  epiphany-browser 2.22.1.1-0ubuntu1
  epiphany-gecko 2.22.1.1-0ubuntu1
  epiphany-extensions 2.22.0-0ubuntu1
  xulrunner-1.9 1.9~b5+nobinonly-0ubuntu1
  xulrunner-1.9-gnome-support 1.9~b5+nobinonly-0ubuntu1
Comment 13 Christian Persch 2008-04-09 11:04:44 UTC
Works here, using 2.22.1.1 with xulrunner trunk.
Comment 14 Christian Persch 2008-04-09 11:07:37 UTC
Hmm actually no it doesn't work, reopening.
Comment 15 asubedi 2008-04-09 12:48:02 UTC
I can confirm that it does not work. I am using epiphany-browser 2.22.1.1-0ubuntu1 on the latest Hardy update.
Comment 16 Christian Persch 2008-04-09 13:46:17 UTC
Fixed in svn.
Comment 17 Peter Clifton 2008-04-16 11:54:05 UTC
I attempted to backport your fixes, and whilst it nolonger downloads silently without prompting, it instead offers the SaveAs / Open dialog as would be found with the auto-open feature turned off.

Is this expected, or did I mess up with the patch backport?
Comment 18 Peter Clifton 2008-04-16 18:52:22 UTC
(Please forgive my newb ignorance in all matters epiphany / gecko)

I found that adding the following diff helps:

--- epiphany-browser-2.22.1.1.orig/embed/mozilla/ContentHandler.cpp»2008-04-16 19:24:54.000000000 +0100
+++ epiphany-browser-2.22.1.1/embed/mozilla/ContentHandler.cpp»·2008-04-16 19:28:07.000000000 +0100
@@ -394,7 +402,7 @@
 »»·mAction = auto_downloads ? CONTENT_ACTION_DOWNLOAD : CONTENT_ACTION_NONE;
 »»·MIMEConfirmAction ();
 »}
-»else if (mAction == CONTENT_ACTION_OPEN_TMP)
+»else if (mAction == CONTENT_ACTION_OPEN_TMP && !auto_downloads)
 »{
 »»·MIMEConfirmAction ();
 »}

(Leading on the the final else, where it calls MIMEDoAction ();)

Why do we need CONTENT_ACTION_OPEN_TMP rather than CONTENT_ACTION_OPEN to make the open in evince etc.. work with Gecko 1.9?

Circa line 465 of ContentHandler.cpp, we have:

	if (mAction == CONTENT_ACTION_OPEN)
	{
		mLauncher->SaveToDisk (nsnull, PR_FALSE);
	}
	else if (mAction == CONTENT_ACTION_OPEN_TMP)
	{
		mLauncher->LaunchWithApplication (nsnull, PR_FALSE);
	}
	else if (mAction == CONTENT_ACTION_NONE)
	{
		mLauncher->Cancel (NS_BINDING_ABORTED);
	}
	else
	{
		mLauncher->SaveToDisk (nsnull, PR_FALSE);
	}


Is it right that its calling mLauncher->SaveToDisk (nsnull, PR_FALSE) for the CONTENT_ACTION_OPEN ?