GNOME Bugzilla – Bug 575498
about: does not seem to work
Last modified: 2011-06-01 16:04:16 UTC
"about:" shows empty page. "about: plugins" does not work either.
about: and about:plugins are old mozilla stuff from the netscape days. The about dialog could easily provide this instead.
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.
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.
Created attachment 176286 [details] [review] hacky webkit patch
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.)
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.
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.
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.
(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
Created attachment 183357 [details] [review] Patch New version: * implemented required changes * css style is now in a separate file
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.
(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...
If you change it to "Plugins" without the hyphen, you could patch up the po files yourself with translations stolen from gedit...
(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" ...
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.
(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?
Committed 89cd6749b82686ca78e8d44c5b3fb18fead02363