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 575498 - about: does not seem to work
about: does not seem to work
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Backend
git master
Other Linux
: Normal normal
: ---
Assigned To: Xan Lopez
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-03-16 06:36 UTC by Priit Laes (IRC: plaes)
Modified: 2011-06-01 16:04 UTC
See Also:
GNOME target: ---
GNOME version: 2.29/2.30


Attachments
Implement about:foo URIs (7.19 KB, patch)
2010-12-12 14:13 UTC, Dan Winship
none Details | Review
hacky webkit patch (5.26 KB, patch)
2010-12-12 14:14 UTC, Dan Winship
none Details | Review
Patch (8.83 KB, patch)
2011-03-01 17:56 UTC, Sergio Villar
none Details | Review
Patch (11.79 KB, patch)
2011-03-04 17:20 UTC, Sergio Villar
reviewed Details | Review
Patch (15.37 KB, patch)
2011-03-14 17:09 UTC, Sergio Villar
reviewed Details | Review

Description Priit Laes (IRC: plaes) 2009-03-16 06:36:56 UTC
"about:" shows empty page.
"about: plugins" does not work either.
Comment 1 Frej Soya 2009-05-08 20:38:08 UTC
about: and about:plugins are old mozilla stuff from the netscape days. 

The about dialog could easily provide this instead.
Comment 2 Reinout van Schouwen 2009-12-18 21:07:58 UTC
Yeah but we don't have a replacement for about:epiphany yet :-)

Moreover I don't agree that the about dialog could provide the plugin info. Look at about:plugins in firefox, it's a lot of info even if you simply install the totem-mozilla plugin.
Comment 3 Dan Winship 2010-12-12 14:13:31 UTC
Created attachment 176285 [details] [review]
Implement about:foo URIs

This requires libsoup master, the epiphany patches from bug 636861,
and the webkit patches from https://bugs.webkit.org/show_bug.cgi?id=50747
and https://bugs.webkit.org/show_bug.cgi?id=50885, plus the (hacky)
WebKit patch I'm about to attach here.
Comment 4 Dan Winship 2010-12-12 14:14:11 UTC
Created attachment 176286 [details] [review]
hacky webkit patch
Comment 5 Dan Winship 2010-12-15 09:08:00 UTC
OK, Xan and I had talked a bit about what to do with SchemeRegistry. I was going to add flags to SoupRequest, which would then get proxied to SchemeRegistry requests by ResourceHandleSoup, but after I started working on it, I decided that was wrong; the flags would be completely uninterpeted by libsoup, they would just be there for webkit to use. So it seems like it would make more sense to add API to webkitgtk. Something like

    void webkit_add_request_type (GType type, WebKitRequestTypeFlags flags);

which internally would look like

    soup_session_add_feature_by_type (webkit_get_default_session (), type);

    request_class = g_type_class_peek (type);
    for (scheme_name in request_class->schemes) {
        if (flags & WEBKIT_REQUEST_TYPE_LOCAL)
            SchemeRegistry::registerURLSchemeAsLocal(scheme_name);
        if (flags & WEBKIT_REQUEST_TYPE_SECURE)
            ...

(I'm busy with non-webkit work for a bit now, so someone else should grab this if they want it sooner rather than later.)
Comment 6 Sergio Villar 2011-03-01 17:56:39 UTC
Created attachment 182194 [details] [review]
Patch

After submitting https://bugs.webkit.org/show_bug.cgi?id=55473 in WebKit, I took Dan's patch and cooked a new version of the SoupRequestAbout that properly generates some fancy HTML output for about:plugins.
Comment 7 Sergio Villar 2011-03-04 17:20:46 UTC
Created attachment 182499 [details] [review]
Patch

As the original approach (take over about: protocol handling from WebKit) was discarded (see https://bugs.webkit.org/show_bug.cgi?id=55473 for more details) I tried with a different approach.
The embedder is the one that translates back and forth about: <-> ephy-about: protocols.  In order to do that the EphyRequestAbout is registered as a handler for ephy-about: protocol (which does not interfere with WebKit's about:). That protocol is used internally but we keep it hidden for the user that only sees "about:plugins" instead of the actual "ephy-about:plugins".

Regarding the implementation of the HTML that shows the list of plugins it could be a good idea to separate the style to a css file and also to get the colors from the theme maybe.
Comment 8 Xan Lopez 2011-03-04 21:47:28 UTC
Review of attachment 182499 [details] [review]:

So... this is pretty hacky, but I'd rather make it a bit less hacky and just replace ephy-about: with about: withouth hardcoding specific URLs.

Other comments follow.

::: embed/ephy-embed-single.c
@@ +546,3 @@
+  requester = SOUP_SESSION_FEATURE (soup_requester_new());
+  soup_session_add_feature (session, requester);
+  soup_session_feature_add_feature (requester, EPHY_TYPE_REQUEST_ABOUT);

Don't you need to unref the requester now?

::: embed/ephy-web-view.c
@@ +2518,3 @@
   if (g_str_has_prefix (address, "file://")) 
     return g_strdup (address + 7);
+  else if (g_intern_static_string(address) == EPHY_ABOUT_PLUGINS_URL)

missing space, although this code should change anyway

::: lib/ephy-request-about.c
@@ +28,3 @@
+	"border-bottom: 1px solid #fff;color: #039; } #box-table-a td { padding: 8px;"\
+	"background: #e8edff;border-bottom: 1px solid #fff; color: #669;"\
+	"border-top: 1px solidtransparent; } #box-table-a tr:hover td { background: #d0dafd; color:#339; }"

Can we format this sanely? :P

@@ +62,3 @@
+				_("Installed plugins"));
+
+	if (uri->path && !g_ascii_strcasecmp (uri->path, "plugins")) {

You can use g_strcmp0

@@ +80,3 @@
+					       _("MIME type"), _("Description"), _("Suffixes"));
+
+			mime_types = webkit_web_plugin_get_mimetypes (plugin);

You need to free this when you are done, webkit_web_plugin_mime_type_list_free.

::: lib/ephy-request-about.h
@@ +22,3 @@
+/* Use this to quickly perform '==' string comparisons */
+#define EPHY_ABOUT_PLUGINS_URL _SOUP_ATOMIC_INTERN_STRING (_EPHY_ABOUT_PLUGINS_URL, EPHY_ABOUT_SCHEME":plugins")
+extern gpointer _EPHY_ABOUT_PLUGINS_URL;

As said before, I'd rather make the checks more generic and get rid of this. Clearly won't be a bottleneck anyway.
Comment 9 Sergio Villar 2011-03-10 10:56:14 UTC
(In reply to comment #8)
> Review of attachment 182499 [details] [review]:
> 
> So... this is pretty hacky, but I'd rather make it a bit less hacky and just
> replace ephy-about: with about: withouth hardcoding specific URLs.

That was the first approach I used, but discarded it in the end because most of the patch became url parsing code. I'll review it and attach a new version

> Other comments follow.
> 
> ::: embed/ephy-embed-single.c
> @@ +546,3 @@
> +  requester = SOUP_SESSION_FEATURE (soup_requester_new());
> +  soup_session_add_feature (session, requester);
> +  soup_session_feature_add_feature (requester, EPHY_TYPE_REQUEST_ABOUT);
> 
> Don't you need to unref the requester now?

Sure
 
> ::: embed/ephy-web-view.c
> @@ +2518,3 @@
>    if (g_str_has_prefix (address, "file://")) 
>      return g_strdup (address + 7);
> +  else if (g_intern_static_string(address) == EPHY_ABOUT_PLUGINS_URL)
> 
> missing space, although this code should change anyway
> 
> ::: lib/ephy-request-about.c
> @@ +28,3 @@
> +    "border-bottom: 1px solid #fff;color: #039; } #box-table-a td { padding:
> 8px;"\
> +    "background: #e8edff;border-bottom: 1px solid #fff; color: #669;"\
> +    "border-top: 1px solidtransparent; } #box-table-a tr:hover td {
> background: #d0dafd; color:#339; }"
> 
> Can we format this sanely? :P

As I said, I didn't care much about the CSS thing. The idea I had was to have a separate CSS file that will be distributed with epy instead of directly hardcoding it in the code. Maybe better for distributions also?

> @@ +62,3 @@
> +                _("Installed plugins"));
> +
> +    if (uri->path && !g_ascii_strcasecmp (uri->path, "plugins")) {
> 
> You can use g_strcmp0

Indeed

> @@ +80,3 @@
> +                           _("MIME type"), _("Description"), _("Suffixes"));
> +
> +            mime_types = webkit_web_plugin_get_mimetypes (plugin);
> 
> You need to free this when you are done, webkit_web_plugin_mime_type_list_free.

Good point
Comment 10 Sergio Villar 2011-03-14 17:09:07 UTC
Created attachment 183357 [details] [review]
Patch

New version:
   * implemented required changes
   * css style is now in a separate file
Comment 11 Xan Lopez 2011-03-19 00:02:32 UTC
Review of attachment 183357 [details] [review]:

::: data/pages/about.css
@@ +7,3 @@
+    text-align: left;
+    border-collapse: collapse;
+}

Shouldn't we just leave the font-family: and font-size: stuff to come from the user prefs...?

::: embed/ephy-history.c
@@ +840,3 @@
+	/* Do not show internal ephy-about: protocol to users */
+	if (g_str_has_prefix (orig_url, EPHY_ABOUT_SCHEME))
+		url = g_strdup_printf ("about:%s", orig_url + strlen (EPHY_ABOUT_SCHEME) + 1);

since that strlen is always the same I guess it can just be another #define.

::: embed/ephy-web-view.c
@@ +2519,3 @@
     return g_strdup (address + 7);
+  else if (!strcmp (address, EPHY_ABOUT_SCHEME":plugins"))
+    return g_strdup (_("Plug-ins"));

Do we have this string already somewhere? We are in string freeze already unfortunately.

@@ +2809,3 @@
     ephy_web_view_set_address (view, NULL);
     ephy_web_view_set_title (view, EMPTY_PAGE);
+  } else if (!strcmp (location, EPHY_ABOUT_SCHEME":plugins")) {

Seems this could be just generic instead of hardcoded to plugins.
Comment 12 Sergio Villar 2011-03-28 15:29:58 UTC
(In reply to comment #11)
> Review of attachment 183357 [details] [review]:
> ::: embed/ephy-web-view.c
> @@ +2519,3 @@
>      return g_strdup (address + 7);
> +  else if (!strcmp (address, EPHY_ABOUT_SCHEME":plugins"))
> +    return g_strdup (_("Plug-ins"));
> 
> Do we have this string already somewhere? We are in string freeze already
> unfortunately.

Unfortunately no. So I guess we'll have to use the plain english version and add translations later...
Comment 13 Dan Winship 2011-03-28 15:47:47 UTC
If you change it to "Plugins" without the hyphen, you could patch up the po files yourself with translations stolen from gedit...
Comment 14 Sergio Villar 2011-03-30 11:41:18 UTC
(In reply to comment #13)
> If you change it to "Plugins" without the hyphen, you could patch up the po
> files yourself with translations stolen from gedit...

It could be done, it'd be a lot of work for me tough :).

What do you think Xan?

BTW: there are also some other new strings needed like the ones in the HTML file "Installed Plugins", "Enabled", "Suffixes" ...
Comment 15 Xan Lopez 2011-04-05 22:23:51 UTC
I think we can just show "Plugins" without translation, or "about:plugins", or whatever, for now. This is mostly a geeky feature anyway, so it's not important.
Comment 16 Sergio Villar 2011-04-11 17:51:51 UTC
(In reply to comment #15)
> I think we can just show "Plugins" without translation, or "about:plugins", or
> whatever, for now. This is mostly a geeky feature anyway, so it's not
> important.

So? Anything else to be done/changed?
Comment 17 Sergio Villar 2011-06-01 16:04:16 UTC
Committed 89cd6749b82686ca78e8d44c5b3fb18fead02363