AppleScript app is not recognized as default browser
Target OS: Macos 10.15.3 Catalina
Goal: use apple script bundled to app as a default web browser
To debug I'm using very simple apple script, that just show passed url in dialog
on open location theURL
display dialog "Passed url : " & theURL
end open location
I also added CFBundleURLTypes
to Info.plist to claim binding to http\https url schemas
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>My test app url</string>
<key>CFBundleURLSchemes</key>
<array>
<string>http</string>
<string>https</string>
</array>
</dict>
</array>
The problem: is that app is not showing up in 'Default web browser' combobox in System Preferences -> General
I've tried to dump Launch Service database
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -dump
And my app is present there.
Also tried force register
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -v -f ./MyTestApp.app
Also tried to sign my app by self issued signature.
Nothing helped.
What could I miss? Is there any additional configurations that should be done to let macos recognize my apple scrip app as possible default browser?
Solution 1:
I do not think that you can build a browser like that, but I do know that there is a very simple browser out that which will take whatever URL it is sent and pass it to the clipboard:
https://github.com/alistairmcmillan/short/tree/master/Copy%20URL%20to%20Clipboard
Perhaps that might help.