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 790781 - Web apps of certain naming fails to launch
Web apps of certain naming fails to launch
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Web Applications
3.26.x
Other Linux
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-11-24 08:05 UTC by Kethen
Modified: 2017-12-29 03:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
application mode: use g_strstr_len to get base name of the desktop file (1.21 KB, patch)
2017-12-28 08:18 UTC, Jonathan Kang
committed Details | Review

Description Kethen 2017-11-24 08:05:17 UTC
I was making web app launchers for messaging apps that I use, then I ran into an issue when I created a launcher called 'WhatsApp'.

After some trial and error I found that no matter what website the web app launcher points to, as long as I name it 'WhatsApp', it will fail to launch with this error:

** (b336fc558722224b7ffe98607055d55f0fe52450:18872): WARNING **: Required desktop file not present at /home/katharine/.config/epiphany/app-epiphany-whatsapp-b336fc558722224b7ffe98607055d55f0fe52450/b336fc558722224b7ffe98607055d55f0fe52450.desktop

However other two launchers with naming 'Facebook Messenger' and 'Telegram' has no issue launching.
Comment 1 Jonathan Kang 2017-12-28 08:18:32 UTC
Created attachment 366035 [details] [review]
application mode: use g_strstr_len to get base name of the desktop file

Currently, g_strrstr() is used to get base name of the desktop file. But
g_strrstr() searches the last occurrence of "app-" instead of the first
occurrence. So if the name of the web application contains "app", users won't be
able to open it.

This is the patch fixing that using g_strstr_len() instead of g_strrstr().
Comment 2 Michael Catanzaro 2017-12-28 17:14:44 UTC
Review of attachment 366035 [details] [review]:

Wow!

Thanks for fixing so many issues, Jonathan.

::: lib/ephy-web-app-utils.c
@@ +351,3 @@
   g_assert (profile_directory != NULL);
 
+  app_name = g_strstr_len (profile_directory, -1, EPHY_WEB_APP_PREFIX);

It would be better to use plain strstr() here.
Comment 3 Jonathan Kang 2017-12-29 03:02:14 UTC
Comment on attachment 366035 [details] [review]
application mode: use g_strstr_len to get base name of the desktop file

> It would be better to use plain strstr() here.

Sure. modified the patch and pushed to master as
commit 521a0e6cc09d09f8aafe152ed90ac2e12869dec0.