Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

carlsson

macrumors 6502a
Original poster
Jul 18, 2001
616
524
A couple of years ago I changed some setting on my Mac to download PDF's instead of reading them directly in Safari.
I did this because I printed labels from a shipping company on internet and it didn't work correctly with my printer at that time, so I had do download the PDF's.

Nowadays though, all this work as it should, and I want to read the PDF's in Safari again. But I can't get the setting back again!

I have moved all Safari settings and files from Library and Application Support, but it doesn't work.

I was about to move my enter Library folder, but that is not permitted.

Does anybode have any idea how to fix this?
 
Yes I have. And that hasnt worked since Big Sur....

I have clicked, and unclicked, and deleted the preference files, and restored the files. Like a couple of times, to no avail.
This lies somewhere deep....

Thanks though.
 
I should add that I have another user on the same Mac, that works as intended. Which means that it's my main user that have the setting.
 
If I remember correctly I used the following command to turn off the automatic "in Safari viewing": defaults write com.apple.Safari WebKitOmitPDFSupport -boolean yes

I have tried to reverse this by putting a "no" at the end, to no avail...
 
I was just about to suggest:
Code:
defaults write com.apple.Safari WebKitOmitPDFSupport -bool NO

I tried it both with YES and NO, and it didn't make a difference. PDFs always open in Safari for me.
 
They have probably changed the command, then. Or something... 🤔
 
Ok... So I deleted the Entire Preferences folder, and one thing works better now: Safari actually opens the file after download.
Now I want to see the file IN Safari. As it does with my other, "fresh out of the box", user...
 
Please check wether you have the acrobat or any other pdf plugin installed, if yes turn it off in Safari’s Websites preferences.
 
Thanks, but no Acrobat or other PDF plugins installed. Neither in /Library/Internet plugins nor in Safari plugins.
 
to switch it back on:
  • defaults write com.apple.Safari WebKitOmitPDFSupport -bool false
EDIT: error fix
 
To clarify:
I have used this site to test the download: https://publikationer.konsumentverket.se/privatekonomi/koll-pa-pengarna

The green button "Ladda ner" means "Download".

When I press that button on my other user that I have on the same Mac (a user that is mostly untouched, most for testing purposes) I see this (ie, the PDF is shown in Safari):
Skärmavbild 2021-04-08 kl. 18.37.47.png

When I press the download button on my regular user (where I have stuff since 100 years ago, at least ;) ) a new tab opens, and the file is downloaded to my Desktop (since I have set that location as a download folder in Safari Preferences (And Yes – I have also tried to set it at the default location (ie Downloads), to no avail)). Nothing more happens. I have to open it manually (unless I delete my entire Preference folder, I still haven't found which file regulates this).
Which means: I get a new empty tab, and the file is on the desktop. Hurray! 😒

I will probably have to reinstall my user, and that is just too much work.. Endless hours of iCloud sync, copying of preference files etc etc.... 😖
 
I can replicate the behaviour by setting: defaults write com.apple.Safari WebKitOmitPDFSupport -bool YES

Can you show the output of:
Code:
defaults read com.apple.Safari | grep -i pdf
and
Code:
defaults read com.apple.safari | grep -i pdf
 
  • Like
Reactions: carlsson
Safari:
WebKitOmitPDFSupport = 0;

safari:
WebKitOmitPDFSupport = 0;



I can guess what that means, but I can't do anyting with this information. 🤔 Thanks for your interest.
 
I was curious whether there might have been a configuration mismatch due to different configuration files. Safari seems to be a bit more complicated, because it also stores its preferences in /Users/[user]/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist. They should be synced with /Users/[user]/Library/Preferences/com.apple.Safari.plist.

The command Slartibart suggested should work, so it wouldn’t matter to try removing the preference key with this:
Code:
defaults delete com.apple.Safari WebKitOmitPDFSupport

The least destructive solution might be to quit Safari and remove both preferences files and potentially remove the Safari container (/Users/[user]/Library/Containers/com.apple.Safari) as well.
 
  • Like
Reactions: carlsson
Thanks Kallt, but I don't have any com.apple.Safari.plist file in the Containers folder. I have a couple of folders, and deleteting them didn't help either.

I have already deleted the .plist file in the Library/Preferences folder (a couple of times), to no avail.
 

Attachments

  • Skärmavbild 2021-04-10 kl. 13.38.14.png
    Skärmavbild 2021-04-10 kl. 13.38.14.png
    64.2 KB · Views: 96
Finally, I do see the PDF's in Safari instead of having them downloaded... 🥳

After spending half a workday with:
  • Moving out all files I could from the Library folder
Loop
  • Restart with extensions disabled
  • Testing Safari and PDF download
  • If it works; Moving in a couple of files in the Library folder
  • Restarting
End loop

...I eventually had a complete Container > com.apple.Safari folder that I couldn't move back without getting the error. Thus, you were correct @KALLT ! I must have missed something when I removed the Container folder before, I'm really not sure.


Thanks fo your help, even though I was too stupid to execute it correct! 😜

🍻
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.