Skip to content

Instantly share code, notes, and snippets.

@dnicolson
Last active August 29, 2015 14:21
Show Gist options
  • Save dnicolson/b18c4ad5b5057a26a8a2 to your computer and use it in GitHub Desktop.
Save dnicolson/b18c4ad5b5057a26a8a2 to your computer and use it in GitHub Desktop.
Google Chrome Canary Default
# Safari no longer allows choosing default browsers from a list
from LaunchServices import LSSetDefaultHandlerForURLScheme
from LaunchServices import LSSetDefaultRoleHandlerForContentType
LSSetDefaultRoleHandlerForContentType("public.html", 0x00000002, "com.google.chrome.canary")
LSSetDefaultRoleHandlerForContentType("public.xhtml", 0x00000002, "com.google.chrome.canary")
LSSetDefaultRoleHandlerForContentType("public.url", 0x00000002, "com.google.chrome.canary")
LSSetDefaultHandlerForURLScheme("http", "com.google.chrome.canary")
LSSetDefaultHandlerForURLScheme("https", "com.google.chrome.canary")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment