sumatrapdfreader / sumatrapdf

SumatraPDF reader
http://www.sumatrapdfreader.org
GNU General Public License v3.0
13.06k stars 1.68k forks source link

Sumatra doesn't keep itself as the default PDF reader, when using Chromium browsers #3300

Open Shideravan opened 1 year ago

Shideravan commented 1 year ago

Google Chrome/Microsoft Edge (probably other Chromium browsers too) is constantly changing itself as the default PDF reader. Can anything be done in Sumatra to avoid this and always keep it as the default PDF reader? If this cannot be resolved, is there anything that can be done in the Windows settings? All the time I keep changing the default reader to Sumatra and it will change again, every time, for example, that I download a .pdf.

version tested: 038b505 Chrome tested: 109.0.5414.120 x64 bits OS: Windows 10

kjk commented 1 year ago

I would love to know if someone has good ideas.

As I understand it, only user is supposed to be allowed to change the settings so even Chrome and Edge should have to ask for permissions to change the associations.

Is that happening? Or is Chrome somehow doing it silently?

How are you setting the association for Sumatra?

Here are the methods I know: https://www.sumatrapdfreader.org/docs/Set-as-default-PDF-viewer

Shideravan commented 1 year ago

Yes, I do this everytime trying to change Sumatra as the default reader. Both changing in the Windows default app setting and using File Explorer. Chrome seems to keeps changing itself silently. And yes, it seems like as an access violation. It seems that some users that use Acrobat Reader have the same issue too https://learn.microsoft.com/en-us/answers/questions/565723/how-is-that-google-chrome-can-make-itself-the-defa Not sure if this was already fixed in Acrobat Reader. I even tried some solutions I found in the web used usually for the Acrobat Reader, but unsuccessfully.

jesuslop commented 1 year ago

Can confirm this. You can tell Chrome to relinquish the association somewhere in settings but then you cannot open pdf links inside Chrome, so it's all or nothing, while the sane UX would have been to open links in browser and open local files in apps. There are the "ftype" and "assoc" commands that manage the association but Chrome will steal it as soon as it opens a pdf.

danbrakeley commented 2 months ago

I just encountered this issue. I'm on Windows 11 Pro, which was installed fresh on an empty drive about a month ago. I normally use Floorp (Firefox-based) for web browsing, and I installed Sumatra and set it up to be the default PDF viewer, and everything seemed fine. Then today I tried to open a PDF and was told I needed to choose an app. However, Sumatra wasn't even an option! I ran Sumatra and verified it was still installed and working, but even going in to Windows Settings and selecting .pdf, I could not choose Sumtra as the default app. I ended up re-downloading and re-running the Sumatra installer, and now I'm able to tell Windows Settings to use Sumatra again.

I recently installed a new browser called Arc, which is chromium-based, and I wonder if that caused it? I never use Edge, and do not have Chrome installed. My day-to-day is still Floorp, so I guess I'll see if the next time I try out Arc, if PDF files get messed up again.