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 120341 - When opening in tabs, the Referer: header isn't set
When opening in tabs, the Referer: header isn't set
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Backend
git master
Other Linux
: Normal normal
: ---
Assigned To: Xan Lopez
Epiphany Maintainers
: 145704 302533 313980 353373 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-08-20 19:54 UTC by elias
Modified: 2009-05-29 16:21 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
proposed fix for webkit (10.19 KB, patch)
2008-12-26 19:11 UTC, Gustavo Noronha (kov)
none Details | Review
proposed patch for webkit (11.99 KB, patch)
2008-12-27 20:54 UTC, Gustavo Noronha (kov)
none Details | Review
Adding the new EphyWebView object (9.20 KB, patch)
2009-01-15 10:31 UTC, Gustavo Noronha (kov)
committed Details | Review
This patch adds loading API to the new object (1.49 KB, patch)
2009-01-15 10:34 UTC, Gustavo Noronha (kov)
committed Details | Review
Actual fix (6.68 KB, patch)
2009-01-15 10:37 UTC, Gustavo Noronha (kov)
none Details | Review
Pull URL normalization up in the chain (2.58 KB, patch)
2009-01-15 10:39 UTC, Gustavo Noronha (kov)
none Details | Review
Remove unused LoadFlags (3.53 KB, patch)
2009-01-15 10:43 UTC, Gustavo Noronha (kov)
none Details | Review
Actual fix (6.14 KB, patch)
2009-05-29 15:47 UTC, Gustavo Noronha (kov)
committed Details | Review
126494: Pull URL normalization up in the chain (2.10 KB, patch)
2009-05-29 15:52 UTC, Gustavo Noronha (kov)
committed Details | Review
Remove unused LoadFlags (4.10 KB, patch)
2009-05-29 15:53 UTC, Gustavo Noronha (kov)
committed Details | Review

Description elias 2003-08-20 19:54:57 UTC
When I click a link with the left mouse button, it is opened, and the
Referer: header is set to the current site. If I instead click with the
middle mouse button to open it in a new tab, the Referer: header is
missing. Some links won't work correctly when opened with the middle button
instead of the left button for that reason.
Comment 1 elias 2003-08-28 13:22:00 UTC
I hope it's ok to add something to a bug I reported myself - but I
found out that Galeon has the same problem, maybe this helps:

http://bugzilla.gnome.org/show_bug.cgi?id=59572

So, once they fix it, maybe the fix can be copied, or the other way
around. I can only say, this definitely works in Mozilla, and it
definitely is a bug, leaving technical aspects aside. From my (user)
view, when I click a link, and it works when left-clicking, it
absolutely should also work when opening in a new tab/window instead,
by middle-clicking.
Comment 2 Marco Pesenti Gritti 2003-08-28 15:46:17 UTC
Yeah it's just not implemented. I filed an rfe to gtkmozembed to add a
referrer argument to load_url a while ago but it's not fixed. Maybe we
should go ahead and use mozilla api directly ...
Comment 3 Christian Persch 2004-07-08 18:26:25 UTC
*** Bug 145704 has been marked as a duplicate of this bug. ***
Comment 4 Christian Persch 2004-08-23 15:07:35 UTC
-> Mozilla interaction
Comment 5 Christian Persch 2004-10-13 10:51:42 UTC
Mass reassigning of Epiphany bugs to epiphany-maint@b.g.o
Comment 6 Christian Persch 2005-04-30 14:56:54 UTC
*** Bug 302533 has been marked as a duplicate of this bug. ***
Comment 7 Sridhar Ratna 2005-04-30 15:08:41 UTC
why is this still not fixed?
Comment 8 Reinout van Schouwen 2005-08-19 22:18:30 UTC
*** Bug 313980 has been marked as a duplicate of this bug. ***
Comment 9 Reinout van Schouwen 2005-08-19 22:56:17 UTC
Updating version fields. The relevent mozilla bug is
https://bugzilla.mozilla.org/show_bug.cgi?id=135659
Comment 10 Reinout van Schouwen 2005-08-28 23:24:37 UTC
There's a patch for mozbug 135659 now that needs testing...
Comment 11 Jean-François Rameau 2006-08-29 10:18:17 UTC
*** Bug 353373 has been marked as a duplicate of this bug. ***
Comment 12 Gustavo Noronha (kov) 2008-12-24 10:39:18 UTC
Just noting that this problem also happens with the webkit from trunk as of today. I'll investigate.
Comment 13 Gustavo Noronha (kov) 2008-12-24 10:58:35 UTC
A quick look tells me that we probably want to have this patch applied to WebKit/GTK+: https://bugs.webkit.org/show_bug.cgi?id=18608.

Along with that, we should refactor ephy_shell_new_tab to accept a WebKitNetworkRequest instead of an URI, and use webkit_web_frame_load_request instead of webkit_web_view_open, which will gain us Referer and any other headers which would be used by webkit for a normal load, instead of we doing a 'faked' load.

I have to test this notion, but I believe this will work.
Comment 14 Gustavo Noronha (kov) 2008-12-26 19:11:37 UTC
Created attachment 125356 [details] [review]
proposed fix for webkit

With current WebKit this patch has two problems:

1. It doesn't really fix the problem it is supposed to fix =); this is because WebKitNetworkRequest is not finished in current WebKit trunk, and only carries the URI; we need the patch in https://bugs.webkit.org/show_bug.cgi?id=18608 applied.

2. It no longer does "normalization" (adding http://) of URI's; it used to do that in impl_load, but since the URI is not reaching it anymore, I'm not sure it is the correct place to do it; should WebKitNetworkRequest do the normalization when the URI is being set?
Comment 15 Gustavo Noronha (kov) 2008-12-27 20:54:13 UTC
Created attachment 125402 [details] [review]
proposed patch for webkit

ok, so this is what this patch does:

  1. uses WebKitNetworkRequest when openning pages
  2. removes load flags; these were aparently used only to decide on whether gecko should be allowed to do its own "normalization" of the URL, and is thus deprecated
  3. moves URL normalization from impl_load to ephy_link_open, since the former now receives a WebKitNetworkRequest
Comment 16 Xan Lopez 2009-01-13 14:15:50 UTC
Looks pretty good (and scary too, we are finally adding WebKit specific stuff to EphyEmbed... ;)), just some nitpicks:

-  webkit_web_view_open (wembed->priv->web_view, effective_url);
-
-  g_free (effective_url);
+  webkit_web_frame_load_request(main_frame, request);

space between function name and parameters.

+	embed = ephy_shell_new_tab_full (shell, parent_window,
+									 previous_embed, request, flags,
+									 EPHY_EMBED_CHROME_ALL, FALSE, 0);
+	

Seems indentation got wrong here.
Comment 17 Xan Lopez 2009-01-13 16:52:34 UTC
As commented on IRC, I think it's best if we don't add webkit-only stuff to the Embed interface, and put this code somewhere else. So we'll create EphyWebView inheriting from WebKitWebView to add things such as this.
Comment 18 Gustavo Noronha (kov) 2009-01-15 10:31:58 UTC
Created attachment 126491 [details] [review]
Adding the new EphyWebView object

The object had to be stuck in embed/ because EphyEmbed will need to use it, and it seemed to me that a dependency from embed to src/ was not intended. This is of course something we will want to move to src/ when possible.
Comment 19 Gustavo Noronha (kov) 2009-01-15 10:34:29 UTC
Created attachment 126492 [details] [review]
This patch adds loading API to the new object

As you can see, I decided to format this work as a patch set. This is because I'm touching multiple issues at once, and because you can also decide to allow me to commit some of them and fix the others for another review round (each one becomes a commit which makes more sense to Ephy's history IMO).
Comment 20 Gustavo Noronha (kov) 2009-01-15 10:37:31 UTC
Created attachment 126493 [details] [review]
Actual fix

Finally, the patch that would fix this issue. I have tested this with my NetworkRequest patch applied to WebKit, and it works, so we better decide if we want to expose SoupMessage in NetworkRequest and get that patch landed, too ;). I could also prepare a smaller patch that only makes NetworkRequest carry the ResourceRequest around, which would be enough for this one.
Comment 21 Gustavo Noronha (kov) 2009-01-15 10:39:45 UTC
Created attachment 126494 [details] [review]
Pull URL normalization up in the chain

This patch is needed so that stuff that use the new and modified code paths will also work when, for instance, URLs are typed in the location bar without 'http://'.
Comment 22 Gustavo Noronha (kov) 2009-01-15 10:43:14 UTC
Created attachment 126495 [details] [review]
Remove unused LoadFlags

Finally, this is a clean-up patch to remove the unused (and unneeded for WebKit) LoadFlags.
Comment 23 Xan Lopez 2009-05-29 14:52:41 UTC
(In reply to comment #18)
> Created an attachment (id=126491) [edit]
> Adding the new EphyWebView object
> 
> The object had to be stuck in embed/ because EphyEmbed will need to use it, and
> it seemed to me that a dependency from embed to src/ was not intended. This is
> of course something we will want to move to src/ when possible.
> 

This seems OK, but please kill all the useless boilerplate before landing (you only need empty class_init and init).
Comment 24 Xan Lopez 2009-05-29 14:54:18 UTC
(In reply to comment #19)
> Created an attachment (id=126492) [edit]
> This patch adds loading API to the new object
> 
> As you can see, I decided to format this work as a patch set. This is because
> I'm touching multiple issues at once, and because you can also decide to allow
> me to commit some of them and fix the others for another review round (each one
> becomes a commit which makes more sense to Ephy's history IMO).
> 

This is mising documentation for the function and checking of the parameters, since it's public API. Otherwise it's OK.
Comment 25 Xan Lopez 2009-05-29 15:03:10 UTC
(In reply to comment #20)

+		ephy_web_view_load_request (EPHY_WEB_VIEW (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed)),
+                                            request);

Indentation.

+	embed = ephy_shell_new_tab_full (shell, parent_window,
+                                         previous_embed, request, flags,
+                                         EPHY_EMBED_CHROME_ALL, FALSE, 0);

Indentation.

-		if (flags & EPHY_LINK_ALLOW_FIXUP)
-		{
-			ephy_embed_load (embed, 
-					 address, 
-					 EPHY_EMBED_LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP,
-					 NULL);
-		}
-		else
-		{
-			ephy_embed_load_url (embed, address);
-		}
+		ephy_embed_load_url (embed, address);

Why is this in this patch?
Comment 26 Xan Lopez 2009-05-29 15:07:08 UTC
(In reply to comment #21)
> Created an attachment (id=126494) [edit]
> Pull URL normalization up in the chain
> 
> This patch is needed so that stuff that use the new and modified code paths
> will also work when, for instance, URLs are typed in the location bar without
> 'http://'.
> 

I've changed this code a bit in upstream, it now uses a ephy-embed-utils to check for proper URLs. Can do you update the patch to do the same?
Comment 27 Xan Lopez 2009-05-29 15:09:18 UTC
(In reply to comment #22)
> Created an attachment (id=126495) [edit]
> Remove unused LoadFlags
> 
> Finally, this is a clean-up patch to remove the unused (and unneeded for
> WebKit) LoadFlags.
> 

Makes sense, but unless I'm missing something you should add stuff from previous patches here. 
Comment 28 Gustavo Noronha (kov) 2009-05-29 15:47:44 UTC
Created attachment 135561 [details] [review]
Actual fix
Comment 29 Xan Lopez 2009-05-29 15:51:52 UTC
(In reply to comment #28)
> Created an attachment (id=135561) [edit]
> Actual fix
> 

OK.
Comment 30 Gustavo Noronha (kov) 2009-05-29 15:52:10 UTC
Created attachment 135562 [details] [review]
126494: Pull URL normalization up in the chain
Comment 31 Gustavo Noronha (kov) 2009-05-29 15:53:12 UTC
Created attachment 135563 [details] [review]
Remove unused LoadFlags
Comment 32 Gustavo Noronha (kov) 2009-05-29 16:21:41 UTC
These are now committed. The change we depend upon for the fix to actually work is already in WebKitGTK+'s svn, and will be in the 1.1.9 release. Yay!