I have older code that could determine the default browser. This code read the defaults for com.apple.LaunchServices. Under Sonoma ( possibly earlier as well ) this is no longer viable.
Is there a modern, reliable method for determining default apps for http, email etc?
You can use this (written with no concern for elegancy):
use AppleScript version "2.4" -- Yosemite (10.10) or later
use framework "Foundation"
use scripting additions
set ca to current application
set nsws to ca's NSWorkspace
set sws to nsws's sharedWorkspace
set appURL to sws's URLForApplicationToOpenURL:(ca's NSURL's URLWithString:"https://apple.com")
appURL's |path| as string
It’s quite possible that easier ways are also available.