You set in Safari preferences to open links from applications in a new tab in the current window. But still some links open in a new windows. How to force Safari to open all new windows in a tab?
You have to set a hidden preference of Safari with a Terminal command:
defaults write com.apple.Safari TargetedClicksCreateTabs -bool true
You’ll need to restart Safari. And to set the preference back with a Terminal command:
defaults write com.apple.Safari TargetedClicksCreateTabs -bool false