WillBC
2020-11-19 11:13:41 +08:00
不保证有效,你可以试试在终端运行下面的代码,然后重启电脑。
html='
<dict>
<key>LSHandlerContentType</key>
<string>public.html</string>
<key>LSHandlerPreferredVersions</key>
<dict>
<key>LSHandlerRoleAll</key>
<string>-</string>
</dict>
<key>LSHandlerRoleAll</key>
<string>com.google.chrome</string>
</dict>
'
xhtml='
<dict>
<key>LSHandlerContentType</key>
<string>public.xhtml</string>
<key>LSHandlerPreferredVersions</key>
<dict>
<key>LSHandlerRoleAll</key>
<string>-</string>
<key>LSHandlerRoleViewer</key>
<string>-</string>
</dict>
<key>LSHandlerRoleAll</key>
<string>com.google.chrome</string>
</dict>
'
http='
<dict>
<key>LSHandlerPreferredVersions</key>
<dict>
<key>LSHandlerRoleAll</key>
<string>-</string>
</dict>
<key>LSHandlerRoleAll</key>
<string>com.google.chrome</string>
<key>LSHandlerURLScheme</key>
<string>http</string>
</dict>
'
https='
<dict>
<key>LSHandlerPreferredVersions</key>
<dict>
<key>LSHandlerRoleAll</key>
<string>-</string>
</dict>
<key>LSHandlerRoleAll</key>
<string>com.google.chrome</string>
<key>LSHandlerURLScheme</key>
<string>https</string>
</dict>
'
defaults write ~/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure.plist LSHandlers -array-add "$html" "$xhtml" "$http" "$https"