GNOME Bugzilla – Bug 702435
Add configurable homepage for kiosk mode
Last modified: 2016-11-01 01:31:40 UTC
Maybe overview is valid as homepage for some kiosk browsers, but in some cases we'll need to set a customized homepage. As a first step we'll need to add back the GSetting removed in commit bea26fc30ac9ff3def2d18d237509a18b3829e27. And use it instead of the overview when it's defined. Maybe it could make sense that this patch is available too in Epiphany outside of the kiosk mode. In that case we'll need to add some UI to define the homepage (previously one was removed in commit 0caf7b0f44349cbfd072cb49dbdc609de317a971).
A GSetting for a customized home page could be useful for sysadmins who want an intranet site to show up for example, but let's not make the mistake of re-introducing a preference for setting a home page. The home page concept is very last-century, the masses use search engines to remember their favorite sites for them anyway.
I agree with keeping it just as a GSetting variable, which is very useful for this specific case of having a default site configured to show up on the kiosk mode. I'd also forget about the UI to configure that setting for the default Epiphany mode.
Created attachment 248795 [details] [review] [PATCH] Reintroduced homepage preference on GSettings Patch that enables setting a custom homepage for Epiphany.
Review of attachment 248795 [details] [review]: Looks good to me, just a few minor issues before pushing it. ::: lib/ephy-prefs.h @@ +70,2 @@ #define EPHY_PREFS_UI_SCHEMA "org.gnome.Epiphany.ui" +#define EPHY_PREFS_HOMEPAGE_URL "homepage-url" This setting is not defined in UI schema, so the #define should be moved below to be showed together with the rest of settings for "org.gnome.Epiphany" schema. ::: src/ephy-window.c @@ +1418,3 @@ G_CALLBACK (ephy_link_open), window); g_object_unref (action); + g_free(address); Nit: Missing space before "(". This could be moved to line before "action =" as it's only used in the if and not needed anymore.
Created attachment 249868 [details] [review] [PATCH] Reintroduced homepage preference on GSettings Fixed the patch based on the suggested comments. Also a "Return without value, in function returning non-void" warning was avoided by changing: - g_return_if_fail (EPHY_IS_WEB_VIEW (view)); + g_return_val_if_fail (EPHY_IS_WEB_VIEW (view), FALSE);
(In reply to comment #6) > Created an attachment (id=249868) [details] [review] > [PATCH] Reintroduced homepage preference on GSettings > > Fixed the patch based on the suggested comments. Also a "Return without value, > in function returning non-void" warning was avoided by changing: > > - g_return_if_fail (EPHY_IS_WEB_VIEW (view)); > + g_return_val_if_fail (EPHY_IS_WEB_VIEW (view), FALSE); Good catch :-)
Review of attachment 249868 [details] [review]: Thanks for the patch. Pushed in kiosk-mode branch: https://git.gnome.org/browse/epiphany/commit/?h=kiosk-mode&id=3d143c0209e755d98c0bbc650ab0ad168e2b5fa6
Created attachment 250026 [details] [review] Rebased patch against current master This setting seems interesting for master too, so I'm providing the rebased patch for current master.
The last version of this patch it's still valid for the current master branch. I also think that this is an interesting feature not only for the kiosk-mode, but for other more generic scenarios. An example of this would be a network environment on which Web homepage could be configured globally on all the systems through dconf profiles, for instance.
Review of attachment 250026 [details] [review]: This will need to be rebased :( ::: embed/ephy-embed-utils.c @@ +159,3 @@ location[0] == '\0' || + strcmp (location, "about:blank") == 0 || + strcmp (location, "about:overview") == 0) In particular, ephy_embed_utils_is_empty has been removed in master.... ::: src/ephy-shell.c @@ +755,3 @@ ephy_web_view_set_typed_address (view, ""); ephy_window_activate_location (window); + is_empty = ephy_web_view_load_homepage (view); This needs rebased too, since the is_empty variable doesn't exist here anymore, but I'm not sure this is the right thing to do anyway. The reason to check if the page is empty is to decide whether it should be replaced with another page, right? E.g. when running 'epiphany www.example.com' from the command line, we probably want to open only www.example.com plus the previously-active tabs, and not www.example.com plus the home page in a new tab. This doesn't matter for kiosk mode, but for users who are stuck in the 1990s and will set this preference because they just want a homepage back. Also, it simplifies the implementation of ephy_web_view_load_homepage, since you don't need to return anything anymore.
Well, kiosk mode is dead and presumably not coming back, but users still complain they can't set a homepage. Let's do this.
The following fix has been pushed: 6b53096 Restore preference to set homepage
Created attachment 338874 [details] [review] Restore preference to set homepage Several users have requested this and even if it seems silly, there's nothing to be gained in denying them. This feature is extremely low-maintenance. This will probably never be well-tested, since hardly anybody wants homepages anymore. Users should be prepared to report bugs if things break or are broken.