! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Support of "ahref" hyperlink tag
Status:
RESOLVED: MOVED
Product:
Xfce4-notifyd
Component:
general

Comments

Description hxss 2017-12-09 18:49:33 CET
Created attachment 7479 
Screenshot of notify with hiperlink

Please add support of hyperlinks.
https://people.gnome.org/~mccann/docs/notification-spec/notification-spec-latest.html#hyperlinks
Now it works like this:
(from chrome)
https://imgur.com/a/vgGS0
Comment 1 Alexandru Curtui 2017-12-14 09:55:39 CET
Created attachment 7489 
An example of the Chrome notification.

Hello,

Someone discussed about this issue on the Chromium bugs list, and thinking that it might be a Chromium issue, I raised the problem again.

It appears to be an issue with the daemon itself.

Here's the thread: https://bugs.chromium.org/p/chromium/issues/detail?id=676220#c103

The issue is also discussed on launchpad: https://bugs.launchpad.net/archlinux/+source/xfce4-notifyd/+bug/1735419
Comment 2 Alexandru Curtui 2017-12-14 10:13:57 CET
The capabilities of the daemon are stated to be:
array [
      actions      body      body-hyperlinks      body-markup      icon-static      x-canonical-private-icon-only   ]

but the body-hyperlinks do not work.
Comment 3 Alexandru Curtui 2018-01-09 12:15:14 CET
Bug present in version 0.4.1-1.
Comment 4 Oleg Muraviov 2018-01-15 12:21:47 CET
I have the same issue. It's not a Chromium problem.
It's reproducible from command line also:
notify-send "Title" "Link to <a href='https://bugzilla.xfce.org'>bugzilla</a>"

Stopped working in version 0.4, works in version 0.3.6
Comment 5 Simon Steinbeiss editbugs 2018-01-15 23:53:44 CET
Yes, I know about this issue and it is a regression of https://git.xfce.org/apps/xfce4-notifyd/commit/?id=8265b411339a390768f2c94f2bc2e0f9983da04b

So I fixed a bug and introduced a regression :/

Unfortunately there are almost no elegant ways of dealing with this, because
1) pango does not support the <a> tag (so the pango_parse_markup check fails)
2) there are no alternative checks in glib or gtk+.

The only way this can be fixed is by parsing and validating the notification string myself, which is what I'll probably end up doing for 0.4.2.
Comment 6 Git Bot editbugs 2018-01-29 00:39:50 CET
Simon Steinbeiss referenced this bugreport in commit 6d178157e49ba60dddf08857950904f43a56dcd6

Fix support for hyperlinks in notifications (Bug #14073)

https://git.xfce.org/apps/xfce4-notifyd/commit?id=6d178157e49ba60dddf08857950904f43a56dcd6
Comment 7 Simon Steinbeiss editbugs 2018-01-29 00:40:23 CET
Fixed the bug in the notification window, the panel plugin and the log viewer.
Comment 8 Or Schiro 2018-01-29 08:49:37 CET
Wow, thank you so much Simon! :-)
Comment 9 Alexandru Curtui 2018-01-29 08:50:23 CET
Same from here, thank you! :)
Comment 10 hxss 2018-01-29 13:05:31 CET
thank you Simon!
Comment 11 hxss 2018-01-29 17:25:15 CET
Simon, links looks good, but they doesn't opens.

I was test notifies from vivaldi(chromium) and from notify-send.
If I copy link and then click on it, then nothing will opened and clipboard will empty.
If I just copy link and close notify then it will in clipboard.

Here is journal:
https://gist.github.com/hxss/5d062ac6611d33e06d2199dbbbf09f4c

I'm test notifies with this site:
https://gauntface.github.io/simple-push-demo/
Comment 12 Simon Steinbeiss editbugs 2018-01-30 23:25:01 CET
Sorry, I can't reproduce your problem. How did you build/install/run notifyd and what's your distro?
Comment 13 hxss 2018-01-30 23:40:07 CET
Arch linux x86_64 4.14.15-1-ARCH.
I was install xfce4-notifyd-git from aur: https://aur.archlinux.org/packages/xfce4-notifyd-git/
After that I was just reboot the system and test notifications.
Comment 14 Alexandru Curtui 2018-01-31 10:06:54 CET
Hi,

I can confirm the issue with the link not opening on click.
Just go to https://tests.peter.sh/notification-generator/ and click "Display the notification".

Best regards!
Comment 15 hxss 2018-01-31 11:10:16 CET
Also you can copy links from logs in xfce4-notifyd-config. And then you will see that all symbols in chrome links replaced by http ascii codes:
https%3A//tests.peter.sh/

And links with '&' can't be parsed: https://imgur.com/a/XaOmL
Comment 16 Simon Steinbeiss editbugs 2018-02-04 14:19:03 CET
Using that webservice does not by default include a hyperlink.

What I noticed is (when testing this on the commandline with notify-send) that hyperlinks that don't start with "http://" end up not opening a browser (supposedly xdg-open doesn't know what to do with them).

But this simple example works just fine for me:
notify-send "a href notification test" "Just a test: <a href='https://tests.peter.sh/notification-generator/'>click me</a>"

This can be clicked both from the log viewer as well as from the notification bubble and will open the page in a browser for me. It currently doesn't work in the panel plugin's log view, that part I can still investigate.

Could either of you put together a complete notify-send example that doesn't work for you?
Comment 17 Alexandru Curtui 2018-02-05 12:37:47 CET
Well, the difference between sending the notification via command line, or the website, is that the website doesn't add any characters before the <a> tag.
Strangely enough, I can't confirm it because even the clickable version (the one sent with "Just a test: <a...") works only the first time, than stops working for a while.

Does it work for you to send a notification and click the link, 3 times in a row (for example)?
Comment 18 Simon Steinbeiss editbugs 2018-02-05 17:06:26 CET
Yes, executing that one-liner three times in a row creates three notification bubbles that are all clickable and open the page as expected.

Not adding any text to the body before the <a> obviously works for me as well:
notify-send "a href notification test" "<a href='https://tests.peter.sh/notification-generator/'>click me</a>"
Comment 19 Simon Steinbeiss editbugs 2018-02-05 17:08:07 CET
Which option do you select to get a hyperlink though? I don't see anything like that in the Body setting (apart from the custom setting of course, then you could manually enter a hyperlink).
Comment 20 hxss 2018-02-05 18:01:19 CET
>Could either of you put together a complete notify-send example that doesn't work for you?

# work:
notify-send "a href notification test" "Just a test: <a href='https://tests.peter.sh/notification-generator/'>click me</a>"
# work:
notify-send "a href notification test" "Just a test: <a href='https://tests.peter.sh/notification-generator/?sad=da'>click me</a>"
# not work, print "<a href..." directly
notify-send "a href notification test" "Just a test: <a href='https://tests.peter.sh/notification-generator/?sad=da&dsa=vcx'>click me</a>"
# not work, print "<a href..." directly
notify-send "a href notification test" "Just a test: <a href='https://tests.peter.sh/notification-generator/?sad=da\&dsa=vcx'>click me</a>"
# not work, print link correctly, can be copied, can't be opened(see my journal gist above)
notify-send "a href notification test" "Just a test: <a href='tests.peter.sh/notification-generator/'>click me</a>"
# not work, print link correctly, can be copied, can't be opened
notify-send "a href notification test" "Just a test: <a href='https%3A//tests.peter.sh/'>click me</a>"

# all notifiers from sites via chrome: 
print link correctly, can be copied, can't be opened
chrome always use ascii codes "%3A" instead of ":"(other char didn't come across)
https%3A//tests.peter.sh/
https%3A//gauntface.github.io/
https%3A//mail.yandex.ru/
Comment 21 Simon Steinbeiss editbugs 2018-02-05 18:20:33 CET
Thanks for the reproducers - now I finally get the problem!

I'm not sure if there's much I can do about certain types of links working in GtkLabel and others not (I'm not doing much about displaying those links currently, it's mostly handled by the widget itself). I'll investigate, but it's possible I won't be able to resolve this entirely.
Comment 22 Simon Steinbeiss editbugs 2018-02-05 20:54:58 CET
Ok, so a little later I can tell you that the hyperlink feature of GtkLabel does not seem to support links like:
* https://tests.peter.sh/notification-generator/?sad=da&dsa=vcx
* https://tests.peter.sh/notification-generator/?sad=da\&dsa=vcx

And the other hyperlinks that are parsed correctly but do not open are not recognized by xdg-open, you can easily test it on the commandline:
* "xdg-open tests.peter.sh/notification-generator/" -> xdg-open fails to detect the URI scheme
* "xdg-open https%3A//tests.peter.sh/" -> same as above

So I fear there is not much we can do apart from opening a bugreport against GtkLabel for parsing more complex URLs correctly (the first two cases). Not sure the xdg-open cases can be fixed properly, because the way e.g. "tests.peter.sh/notification-generator/" looks it could also be a file location.


The only thing I could in theory try to fix is being able to click the hyperlinks (that work) in the plugin's menu, but currently the click is swallowed by the GtkMenu and I'm not sure I really want to hack into that...
Comment 23 hxss 2018-02-05 22:01:58 CET
For me links without "http://" not a problem. Main future is support of chrome  links(https%3A//tests.peter.sh/).
Can you write temporary workaround parser(I think it need only 1 regex /%(\w{2})/\1/ and translator ascii2char)?
Comment 24 Simon Steinbeiss editbugs 2018-03-01 01:00:27 CET
Nope, I really can't write a parser for that. All the magic happens inside GtkLabel.

I'll accept patches though if you really want to work on this!
Comment 25 hxss 2018-03-03 13:41:53 CET
Created attachment 7624 
link-parser-workaround.patch

This patch solve problem of parsing links:
1. with html ascii codes ("%3A")
2. with '&' char(replace it by "&amp;")
3. links without protocol(add "http://" as default protocol)

So now all this links can be parsed by GtkLabel, displays correctly and can be copied.
BUT! Now I can't open ANY link after some system(or notifyd) upgrades. Even links that was works before(https://bugzilla.xfce.org/show_bug.cgi?id=14073#c20)

Please help me. I can't fully test notifications now.
Comment 26 hxss 2018-03-03 15:14:49 CET
I recieve this logs even when trying simple google.com example:

$ notify-send "a href notification test" "Just a test: <a href='http://google.com'>click me</a>"

2018-03-03T19:13:05+0500 lenovo xfce4-notifyd[815]: Just a test: <a href='http://google.com'>click me</a>
2018-03-03T19:13:05+0500 lenovo xfce4-notifyd[815]: Just a test: <a href='http://google.com'>click me</a>
2018-03-03T19:13:09+0500 lenovo kernel: traps: xfce4-notifyd[815] general protection ip:7fbd83e63c17 sp:7ffec37ecbb0 error:0 in libgtk-3.so.0.2200.28[7fbd83ad5000+707000]
2018-03-03T19:13:09+0500 lenovo systemd[1]: Created slice system-systemd\x2dcoredump.slice.
2018-03-03T19:13:09+0500 lenovo systemd[1]: Started Process Core Dump (PID 1421/UID 0).
2018-03-03T19:13:09+0500 lenovo systemd[676]: xfce4-notifyd.service: Main process exited, code=dumped, status=11/SEGV
2018-03-03T19:13:09+0500 lenovo kernel: traps: vivaldi-bin[1438] trap int3 ip:5598f2d6c9c0 sp:7ffdf78e66f0 error:0 in vivaldi-bin[5598f1c42000+6ae9000]
2018-03-03T19:13:09+0500 lenovo systemd[1]: Started Process Core Dump (PID 1440/UID 0).
2018-03-03T19:13:09+0500 lenovo systemd-coredump[1424]: Process 815 (xfce4-notifyd) of user 1000 dumped core.
                                                        
                                                        Stack trace of thread 815:
                                                        #0  0x00007fbd83e63c17 gtk_widget_get_display (libgtk-3.so.0)
                                                        #1  0x00007fbd83e864bf n/a (libgtk-3.so.0)
                                                        #2  0x00007fbd82a2e24c n/a (libgio-2.0.so.0)
                                                        #3  0x00007fbd82a2e289 n/a (libgio-2.0.so.0)
                                                        #4  0x00007fbd8247fca6 g_main_context_dispatch (libglib-2.0.so.0)
                                                        #5  0x00007fbd82480081 n/a (libglib-2.0.so.0)
                                                        #6  0x00007fbd824803b2 g_main_loop_run (libglib-2.0.so.0)
                                                        #7  0x00007fbd83d09eff gtk_main (libgtk-3.so.0)
                                                        #8  0x0000559ef3c294e1 n/a (xfce4-notifyd)
                                                        #9  0x00007fbd81e80f4a __libc_start_main (libc.so.6)
                                                        #10 0x0000559ef3c295ca n/a (xfce4-notifyd)
                                                        
                                                        Stack trace of thread 1419:
                                                        #0  0x00007fbd81f50879 syscall (libc.so.6)
                                                        #1  0x00007fbd824c6dcd g_cond_wait_until (libglib-2.0.so.0)
                                                        #2  0x00007fbd82453753 n/a (libglib-2.0.so.0)
                                                        #3  0x00007fbd824a8c76 n/a (libglib-2.0.so.0)
                                                        #4  0x00007fbd824a826a n/a (libglib-2.0.so.0)
                                                        #5  0x00007fbd8221e08c start_thread (libpthread.so.0)
                                                        #6  0x00007fbd81f55e7f __clone (libc.so.6)
                                                        
                                                        Stack trace of thread 817:
                                                        #0  0x00007fbd81f4b97b __poll (libc.so.6)
                                                        #1  0x00007fbd8247fff3 n/a (libglib-2.0.so.0)
                                                        #2  0x00007fbd8248010e g_main_context_iteration (libglib-2.0.so.0)
                                                        #3  0x00007fbd82480162 n/a (libglib-2.0.so.0)
                                                        #4  0x00007fbd824a826a n/a (libglib-2.0.so.0)
                                                        #5  0x00007fbd8221e08c start_thread (libpthread.so.0)
                                                        #6  0x00007fbd81f55e7f __clone (libc.so.6)
                                                        
                                                        Stack trace of thread 1420:
                                                        #0  0x00007fbd81f50879 syscall (libc.so.6)
                                                        #1  0x00007fbd824c6dcd g_cond_wait_until (libglib-2.0.so.0)
                                                        #2  0x00007fbd82453753 n/a (libglib-2.0.so.0)
                                                        #3  0x00007fbd824a8c76 n/a (libglib-2.0.so.0)
                                                        #4  0x00007fbd824a826a n/a (libglib-2.0.so.0)
                                                        #5  0x00007fbd8221e08c start_thread (libpthread.so.0)
                                                        #6  0x00007fbd81f55e7f __clone (libc.so.6)
                                                        
                                                        Stack trace of thread 819:
                                                        #0  0x00007fbd81f4b97b __poll (libc.so.6)
                                                        #1  0x00007fbd8247fff3 n/a (libglib-2.0.so.0)
                                                        #2  0x00007fbd824803b2 g_main_loop_run (libglib-2.0.so.0)
                                                        #3  0x00007fbd82a746d8 n/a (libgio-2.0.so.0)
                                                        #4  0x00007fbd824a826a n/a (libglib-2.0.so.0)
                                                        #5  0x00007fbd8221e08c start_thread (libpthread.so.0)
                                                        #6  0x00007fbd81f55e7f __clone (libc.so.6)
2018-03-03T19:13:09+0500 lenovo systemd[676]: xfce4-notifyd.service: Failed with result 'core-dump'.
2018-03-03T19:13:09+0500 lenovo systemd-coredump[1441]: Process 1438 (vivaldi-bin) of user 1000 dumped core.
                                                        
                                                        Stack trace of thread 1:
                                                        #0  0x00005598f2d6c9c0 n/a (vivaldi-bin)
Comment 27 Simon Steinbeiss editbugs 2018-03-04 00:44:06 CET
To be honest I get some warnings when building notifyd with your diff:
http://dpaste.com/0E2Q5ZB

Not sure what would have changed in your system so you can't click links anymore, potentially xdg-open/exo-open..? Or maybe you updated your browser and the "default" selection of exo-open/xdg-open doesn't work anymore?
Comment 28 hxss 2018-03-04 09:53:55 CET
I was try to use other browsers(Chrome, Firefox) - same problem.
And this problem exist even with clear xfce4-notifyd-git 0.4.2.r3.g1652201-1

>exo-open/xdg-open

both works good. New tab opens.

$ xdg-open http://google.com 
$ [4852:4890:0304/134746.640454:ERROR:browser_gpu_channel_host_factory.cc(108)] Failed to launch GPU process. 
Created new window in existing browser session.

$ exo-open http://google.com 
$ [5037:5076:0304/134832.615798:ERROR:browser_gpu_channel_host_factory.cc(108)] Failed to launch GPU process. 
Created new window in existing browser session.

$ xdg-open https://tests.peter.sh/notification-generator/ 
$ [5178:5216:0304/134859.429524:ERROR:browser_gpu_channel_host_factory.cc(108)] Failed to launch GPU process. 
Created new window in existing browser session.
Comment 29 hxss 2018-03-05 14:04:11 CET
Created attachment 7626 
link-parser-workaround-2.patch

I was move patch call from xfce_notify_window_set_body into notify_notify.
So now parsed links shows also in notifyd-config log tab.
From this tab all links opens without any error. All 3 types of "broken" links.

Still receive errors when try to open any link from notification bubble.
Comment 30 Simon Steinbeiss editbugs 2018-03-08 22:42:19 CET
I really appreciate the patch/es, but could you please use git patches instead? This would make it easier to apply them plus it would include committer and commit message.

I presume including syslog is just a temporary debug proposal and this is not the final version of the patch, correct?
Comment 31 hxss 2018-03-09 08:58:12 CET
Yes, syslog is just for debug. This is my first C-project and first patch, so here is warnings.

Can you do something with label in notify buble or this is fully gtk problem?
Comment 32 Simon Steinbeiss editbugs 2018-03-18 01:10:07 CET
Took me some time to get to test this.

So first of all: it seems to work for all the examples you listed above and I can successfully click those links in the notification windows. Haven't tested the log yet and haven't checked the code in detail yet to get rid of the warnings, but it seems like a good first step.
Thanks for your work!
Comment 33 Git Bot editbugs 2020-05-24 20:05:36 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/apps/xfce4-notifyd/-/issues/9.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #14073

Reported by:
hxss
Reported on: 2017-12-09
Last modified on: 2020-05-24

People

Assignee:
Simon Steinbeiss
CC List:
4 users

Version

Attachments

Additional information