Bug 487929 - Links doesn't open in browser, the page gets downloaded and a pop up appears asking you how to open the downloaded file.
Summary: Links doesn't open in browser, the page gets downloaded and a pop up appears ...
Status: REPORTED
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-02 16:33 UTC by haxel
Modified: 2024-11-26 15:37 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
the pop up that appears. (29.44 KB, image/png)
2024-06-02 16:33 UTC, haxel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description haxel 2024-06-02 16:33:44 UTC
Created attachment 170066 [details]
the pop up that appears.

***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

SUMMARY


STEPS TO REPRODUCE
1.  start okular.
2. open a pdf file with a link.
3. click on the link

OBSERVED RESULT
the html page is downloaded to a file (~/.cache/kioexec/krun/304260_0/name_of_the_link_page), and a pop up appears saying " Select the program you want to use to open file name_of_the_link_page". and upon selecting chrome it opens the file in chrome and all i can see then is raw html code in the browser, and the address bar pointing somewhere on my computer (local file)

EXPECTED RESULT
click link > open the link in the browser.

SOFTWARE/OS VERSIONS
Linux: 6.9.3-arch1-1
distro: arch linux
window manager: dwm

ADDITIONAL INFORMATION:
~  λ  pacman -Qsq kde
frameworkintegration
kdecoration
libappindicator-gtk3
libblockdev
libblockdev-crypto
libblockdev-fs
libblockdev-loop
libblockdev-mdraid
libblockdev-nvme
libblockdev-part
libblockdev-swap
okular
phonon-qt6
plasma-activities
signon-kwallet-extension
Comment 1 Alejandro Villar 2024-06-07 09:24:06 UTC
In my case (Ubuntu 24.04 LTS with okular 4:23.08.5-0ubuntu5), the URLs are first queried and then the default text/html handler is opened (Kate on my machine), instead of being opened directly by Firefox (my default browser).

If I change the file association for text/html to Firefox, Okular first fetches the URL and then passes it (the URL, not the fetched file) to Firefox, so in essence the resourced is retrieved twice (confirmed with Wireshark).

I think this behavior is due to the following change, in which KRun is replaced with KIO::OpenUrlJob: https://github.com/KDE/okular/commit/1b479dfb7b

Not a QT or KDE expert, but could this maybe be replaced with QDesktopServices::openUrl()?
Comment 2 Alejandro Villar 2024-06-07 10:10:11 UTC
I can confirm that after changing the URL handling methods to QDesktopServices::openUrl(), links are opened directly in Firefox.

Note: the sources for my version didn't have the KRun->KIO::OpenUrlJob change yet, so maybe something changed in KRun?
Comment 3 Nicolas Fella 2024-06-07 11:05:03 UTC
See https://bugs.kde.org/show_bug.cgi?id=439477