By Dan Moren
September 18, 2018 12:00 PM PT
Give new life to old extensions in Safari 12
Note: This story has not been updated for several years.
Among yesterday’s barrage of updates was a seemingly minor one: Safari 12. While the most notable news of Apple’s latest browser might have been the long-awaited ability to display favicons in tabs, there were a handful of other changes, including a few to extensions that may be unpopular.
Firstly, Safari no longer supports extensions cryptographically signed by developers themselves. The browser also implements a new Safari App Extensions API, which doesn’t have all the features of the previous, now deprecated extension API, causing some developers to cease work on extensions.1
The good news is that there is still a way to run these extensions for the time being. (My thanks to my friend John Siracusa for letting me in on the secret.) But this approach does come with a few caveats:
- Developer-signed certificates can potentially be unsafe, which is one reason why Apple is not allowing them anymore. If you’re going to use this feature, I’d recommend limiting it to older extensions that you already trust, not necessarily as a way to bypass security restrictions for new extensions.
Sooner or later, this trick will probably stop working, and/or older extensions will no longer function correctly with new versions of Safari. It’s unclear when this might happen—you may get a couple years out of them yet, and perhaps by the time they do, sanctioned alternatives will become available.
One downside to this approach, based on my testing with the Mojave public beta, is that every system update re-enforced the new rules, meaning that you might potentially have to perform this procedure again in the future.
Those warnings out of the way, here’s how to actually run those old extensions on your Mac.
Extensions are stored in
~/Library/Safari/Extensions. Fortunately, Safari 12 doesn’t remove the extension files for deprecated or inactive extensions. Drag any extensions you want to save from here onto your desktop; I recommend putting them into a folder.
The next part of this requires a little command-line trickery, so fire up Terminal, navigate to that directory you just created on the desktop (or just type
cd followed by a space in the Terminal window and drag the folder you just made on your desktop into the Terminal window).
xar -xf followed by a space and the name of the extension file, and hit enter. (Tip: If you type the first few characters and hit the Tab key, it’ll autocomplete the rest.) Repeat for each extension file. You’ll now have a folder of source files for each extension.
Now open Safari. If you don’t already have the Develop menu in the menu bar, go to Safari > Preferences, click on the Advanced tab, and check the “Show Develop menu in menu bar” option.
There should now be a Develop menu between the Bookmarks and Window menus; from it, select Show Extension Builder.
The first time you open the Extension Builder, you’ll be asked whether you really want to use it instead of Xcode: you do. Click Continue.
At the bottom of the Extension Builder window click the Plus (+) button and choose Add Extension. You’ll get a standard Open dialog box; navigate to that folder on your desktop where you put your extension files and choose the folder with the extension name; it’ll have the extension
.safari extension. (You can select multiple extensions by Command-clicking the folders, otherwise you’ll have to perform the Add Extension command multiple times for each different extension.) Click Select.
You’ll now see your old extensions in the left hand column, with information about them in the pane on the right side. Click the Run button in the top right-hand corner; you’ll be prompted for your password. Repeat this step for each extension you want to run.
And voilÃ : you’re done. Your extensions should now be running and should appear in the Extensions pane of Safari’s preferences. As I said above, it’s not a permanent solution, but if you’re looking to eke a little more life out of much-loved extensions, this will hopefully tide you over for now.
Update: Several people have pointed out that Safari will not run these extensions by default when you launch Safari. George Garside has a solution for that, but it will require you to run an Apple Script. Your mileage may vary.
- Safari Keyword Search has been an indispensable piece of software for me over the past many years, and I am devastated to see that the writing is on the wall for it, especially with no real alternatives. ↩
[Dan Moren is the East Coast Bureau Chief of Six Colors. You can find him on Mastodon at @firstname.lastname@example.org or reach him by email at email@example.com. His latest novel, the supernatural detective story All Souls Lost, is out now.]
If you appreciate articles like this one, support us by becoming a Six Colors subscriber. Subscribers get access to an exclusive podcast, members-only stories, and a special community.