{"id":29975,"date":"2020-09-01T16:46:17","date_gmt":"2020-09-01T20:46:17","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=29975"},"modified":"2020-09-01T16:51:09","modified_gmt":"2020-09-01T20:51:09","slug":"setting-default-url-handlers","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2020\/09\/01\/setting-default-url-handlers\/","title":{"rendered":"Setting Default URL Handlers"},"content":{"rendered":"<p><a href=\"https:\/\/twitter.com\/brentsimmons\/status\/1300571980488294402\">Brent Simmons<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/brentsimmons\/status\/1300571980488294402\">\n<p>NetNewsWire lets you set the default RSS reader to itself or any other RSS reader. It&rsquo;s an important feature.<\/p>\n<p>Now that we&rsquo;re sandboxing the app, we&rsquo;re losing that feature, as <code>LSSetDefaultHandlerForURLScheme<\/code> is apparently disallowed for sandboxed apps[&#8230;]<\/p>\n<\/blockquote>\n\n<p>This is a good example of how the sandbox still feels half-baked. 9 years later, it&rsquo;s not documented that this function doesn&rsquo;t work in sandboxed apps. There&rsquo;s no replacement API, e.g. that asks the user whether it&rsquo;s OK to change the URL handler. The system UI for setting the preferred RSS app has been removed, so the user can&rsquo;t do it manually.<\/p>\n\n<p>Was it worth it? Was there an epidemic of URL handler changers that we&rsquo;re being protected from? Apps in the Mac App Store need to be sandboxed, and if this API were enabled in the sandbox it could in theory be policed by App Review, anyway. Apps outside the Mac App Store don&rsquo;t need to be sandboxed, and malware certainly isn&rsquo;t, so the restriction only affects legitimate apps that are trying to do the right thing&mdash;which the restriction discourages.<\/p>\n\n<p><a href=\"https:\/\/twitter.com\/justkwin\/status\/1300688748229861376\">Quinn<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/justkwin\/status\/1300688748229861376\">\n<p>If you&rsquo;re sandboxing just because it&rsquo;s the right thing to do, you should be able to move this call to a non-sandboxed XPC Service<\/p>\n<\/blockquote>\n\n<p>However, this would not be allowed in the Mac App Store.<\/p>\n\n<p><a href=\"https:\/\/twitter.com\/Schwieb\/status\/1300589433264070656\">Erik Schwiebert<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/Schwieb\/status\/1300589433264070656\"><p>Outlook used to have a pref like that to set itself as the default mail reader. We deleted it when we sandboxed the Mac Office apps, and now point admins to tools like <a href=\"https:\/\/github.com\/moretension\/duti\">duti<\/a>. Not end-user friendly, but I don&rsquo;t know a way around it.<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Brent Simmons: NetNewsWire lets you set the default RSS reader to itself or any other RSS reader. It&rsquo;s an important feature. Now that we&rsquo;re sandboxing the app, we&rsquo;re losing that feature, as LSSetDefaultHandlerForURLScheme is apparently disallowed for sandboxed apps[&#8230;] This is a good example of how the sandbox still feels half-baked. 9 years later, it&rsquo;s [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2020-09-01T20:46:21Z","apple_news_api_id":"e3b26f35-c827-44c7-beec-13d538d5ab12","apple_news_api_modified_at":"2020-09-01T20:51:14Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAA==","apple_news_api_share_url":"https:\/\/apple.news\/A47JvNcgnRMe-7BPVONWrEg","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[438,30,39,1666,1605,392,71,52,53,489,1473],"class_list":["post-29975","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-launchservices","tag-mac","tag-macappstore","tag-macos-10-15","tag-microsoft-outlook","tag-netnewswire","tag-programming","tag-rss","tag-sandboxing","tag-url","tag-xpc"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/29975","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=29975"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/29975\/revisions"}],"predecessor-version":[{"id":29976,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/29975\/revisions\/29976"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=29975"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=29975"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=29975"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}