Bug 463994 - Okular fails to open HTTPS URLs to PDF files
Summary: Okular fails to open HTTPS URLs to PDF files
Status: REOPENED
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (show other bugs)
Version: 21.12.2
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-08 08:04 UTC by Yann Salmon
Modified: 2024-04-09 12:14 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Example file (6.74 KB, application/pdf)
2023-01-08 08:04 UTC, Yann Salmon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yann Salmon 2023-01-08 08:04:21 UTC
Created attachment 155101 [details]
Example file

SUMMARY

STEPS TO REPRODUCE
1. Create file /tmp/essai/thing.pdf containing a link to say https://docs.kde.org/stable5/en/okular/okular/okular.pdf
2. Open /tmp/essai/thing.pdf and click link.

OBSERVED RESULT
Okular opens another window of itself, which displays an error about not being able to open file:///tmp/essai/https:/docs.kde.org/stable5/en/okular/okular/okular.pdf

(notice only one slash after https:)

EXPECTED RESULT
Okular should open linked PDF file either in the browser or another Okular window.


SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.24.7
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION
Right clicking link and copying address gives the correct URL.
URL to non-PDFs seems unaffected.
Links that do not literally end with .pdf but 302-redirect to a PDF are affected (see 3rd link in example file).
Comment 1 Paul Worrall 2023-01-08 11:02:36 UTC
For me, all three links open the correct document in Firefox.

SYSTEM:
KDE Neon User Edition with all default settings
Okular: 22.12.0
Plasma: 5.26.4
Frameworks: 5.101.0
Qt: 5.15.7

Maybe worth checking what you've got in System Settings => Applications => Default Applications => Web browser ?  I have "Firefox Web Browser"
Comment 2 Yann Salmon 2023-01-08 11:12:09 UTC
It says Firefox there, presumably because I take it directly from Mozilla (not Ubuntu's snap) and created the desktop file myself.

Non-PDF links clicked in Okular do open in my firefox instance.
Comment 3 Yann Salmon 2023-01-08 12:32:07 UTC
Also note that atril opens the links correctly, and that evince fails to all three, but that is because for some reason it gets ``exec: /opt/yann/firefox/firefox-bin: Permission denied`` so at least it is trying to do the right thing.
Comment 4 Nate Graham 2023-01-09 22:08:55 UTC
They open in the browser for me too.

What happens if you run `xdg-open https://docs.kde.org/stable5/en/okular/okular/okular.pdf` in a terminal window?

Can you paste the output of running `grep -E "pdf|http" ~/.config/mimeapps.list` in a terminal window?
Comment 5 Yann Salmon 2023-01-09 23:11:43 UTC
1. It opens in Firefox.

2.
```
application/pdf=okularApplication_pdf.desktop;userapp-evince-ZGIKLZ.desktop;inkscape.desktop;gimp.desktop;libreoffice-draw.desktop;libreoffice-writer.desktop;userapp-bless-FBYQTY.desktop;userapp-emacs-KNM4TY.desktop;
x-scheme-handler/http=firefox.desktop;
x-scheme-handler/https=firefox.desktop;
application/pdf=okularApplication_pdf.desktop;
x-scheme-handler/http=userapp-Firefox-FVD3O1.desktop
x-scheme-handler/https=userapp-Firefox-FVD3O1.desktop
```
Comment 6 Nate Graham 2023-01-10 22:04:24 UTC
Hmm, this looks a bit suspicious to me:

x-scheme-handler/http=firefox.desktop;
x-scheme-handler/https=firefox.desktop;
x-scheme-handler/http=userapp-Firefox-FVD3O1.desktop
x-scheme-handler/https=userapp-Firefox-FVD3O1.desktop

You have "x-scheme-handler/http" and "x-scheme-handler/https" defined twice. Presumably the second one is for a custom override for Firefox's desktop file.

If you remove the override lines and reboot, does the problem go away?
Comment 7 Bug Janitor Service 2023-01-25 05:06:40 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 8 Bug Janitor Service 2023-02-09 03:54:38 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!
Comment 9 Yann Salmon 2023-03-17 08:17:53 UTC
I rather removed 
x-scheme-handler/http=firefox.desktop;
x-scheme-handler/https=firefox.desktop;

because there is no such desktop file on my computer, and the other file does lunch Firefox (I get it from Mozilla directly, and it is installed under /opt).

The problem still persists after this operation.
Comment 10 Mateusz Stachowski 2024-04-09 08:56:00 UTC
I don't know if that bug was reported in relation to snap package of Okular, but it showed up when I searched for okular snap.

I'm on Ubuntu 24.04 development release and using snapd from the edge channel.

snap version
snap    2.62+git2055.gb131534
snapd   2.62+git2055.gb131534
series  16
ubuntu  24.04
kernel  6.8.4-x64v3-xanmod1

I checked the example file and all three links opened in my default browser Vivaldi.

I also used a link from three PDF files on my system and those also worked.
Comment 11 Mateusz Stachowski 2024-04-09 12:14:10 UTC
I also checked that siwtching the default browser works.

I had Okular snap open with two PDF files, and I opened unity-control-center under Information there is a default programs setting (WWW, Mail, Calendar, Music, Video). I changed WWW which is setting for default browser to Chromium.

Then in Okular snap I clicked link which opened in Chromium.

Then I switched back to Vivaldi as default and the link opened in this browser.