{"id":36601,"date":"2022-07-27T17:12:22","date_gmt":"2022-07-27T21:12:22","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=36601"},"modified":"2022-07-27T17:12:22","modified_gmt":"2022-07-27T21:12:22","slug":"disappearing-safari-extensions","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2022\/07\/27\/disappearing-safari-extensions\/","title":{"rendered":"Disappearing Safari Extensions"},"content":{"rendered":"<p><a href=\"https:\/\/lapcatsoftware.com\/articles\/disappearing-safari.html\">Jeff Johnson<\/a>:<\/p>\n<blockquote cite=\"https:\/\/lapcatsoftware.com\/articles\/disappearing-safari.html\"><p> I&rsquo;ve received a number of bug reports from customers saying that the extension doesn&rsquo;t appear in Safari. And when my app calls the API <code>[SFSafariApplication showPreferencesForExtensionWithIdentifier: completionHandler:]<\/code> to show the extension in Safari Preferences, there&rsquo;s an error &ldquo;SFErrorDomain error 1&rdquo;.<\/p>\n<p>[&#8230;]<\/p>\n<p>My command above forces Launch Services to re-register the Safari app. In order to diagnose the issue, I saved the output of <code>lsregister -dump<\/code> to a file both before and after re-registering Safari. When I compared the files, there were a number of differences, mostly trivial (e.g., timestamps), but one big difference stood out to me. The extension point <code>com.apple.Safari.web-extension<\/code> appeared in the &ldquo;after&rdquo; dump but not in the &ldquo;before&rdquo; dump[&#8230;]<\/p>\n<p>[&#8230;]<\/p>\n<p>I don&rsquo;t know what caused the <code>com.apple.Safari.web-extension<\/code> extension point to become unregistered with Launch Services. That&rsquo;s still a mystery. Obviously this appears to be some kind of OS bug that occurs on Big Sur but not Mojave.<\/p><\/blockquote>\n\n<p><a href=\"https:\/\/lapcatsoftware.com\/articles\/disappearing-safari2.html\">Jeff Johnson<\/a>:<\/p>\n<blockquote cite=\"https:\/\/lapcatsoftware.com\/articles\/disappearing-safari2.html\">\n<p>If anything, the bug gotten worse. It&rsquo;s happening to me rather frequently now. And it continues to happen to other Safari users, not just users of my Safari web extension <a href=\"https:\/\/apps.apple.com\/app\/tweaks-for-twitter\/id1567751529\">Tweaks for Twitter<\/a>, but to users of all Safari web extensions from every developer.<\/p>\n<p>As a reminder, if your Safari web extensions have disappeared, you can restore them with a command in Terminal:<\/p>\n<pre>\/System\/Library\/Frameworks\/CoreServices.framework\/Frameworks\/LaunchServices.framework\/Support\/lsregister -f -R \/Applications\/Safari.app<\/pre>\n<p>However, this command might not restore your extension data. I&rsquo;ve found that in some cases, Safari not only forgets the extensions, it also erases the extension <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Mozilla\/Add-ons\/WebExtensions\/API\/storage\">storage<\/a>!<\/p>\n<\/blockquote>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2021\/05\/19\/tweaks-for-twitter-1-0\/\">Tweaks for Twitter 1.0<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Jeff Johnson: I&rsquo;ve received a number of bug reports from customers saying that the extension doesn&rsquo;t appear in Safari. And when my app calls the API [SFSafariApplication showPreferencesForExtensionWithIdentifier: completionHandler:] to show the extension in Safari Preferences, there&rsquo;s an error &ldquo;SFErrorDomain error 1&rdquo;. [&#8230;] My command above forces Launch Services to re-register the Safari app. In [&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":"2022-07-27T21:12:25Z","apple_news_api_id":"d4accce9-8dcd-47a8-9ead-2d432f9ca573","apple_news_api_modified_at":"2022-07-27T21:12:25Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/A1KzM6Y3NR6ierS1DL5ylcw","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":[2],"tags":[131,438,30,1891,2077,103,2246],"class_list":["post-36601","post","type-post","status-publish","format-standard","hentry","category-technology","tag-bug","tag-launchservices","tag-mac","tag-macos-11-0","tag-macos-12","tag-safari","tag-safari-extensions"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/36601","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=36601"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/36601\/revisions"}],"predecessor-version":[{"id":36602,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/36601\/revisions\/36602"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=36601"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=36601"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=36601"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}