Skip to content

Instantly share code, notes, and snippets.

@zhuowei
Created June 15, 2021 02:02
Show Gist options
  • Save zhuowei/8ad1dd478df0efeb67baf2088e5cd85e to your computer and use it in GitHub Desktop.
Save zhuowei/8ad1dd478df0efeb67baf2088e5cd85e to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UnifiedBar</key>
<dict>
<key>DisclosureRequired</key>
<string>ace440ac-b4f6-4b43-aade-02bba1589aef</string>
<key>Enabled</key>
<false/>
</dict>
</dict>
</plist>

To get old tab bars on Safari for macOS 12, create

/Library/Preferences/FeatureFlags/Domain/Safari.plist

copy the above into it, and reboot.


The feature is controlled by

+[FeatureAvailability isUnifiedBarEnabled]

which calls os_feature_enabled, which searches in /System/Library/FeatureFlags/Domain/Safari.plist and /Library/Preferences/FeatureFlags/Domain/Safari.plist.

I copied the System file, removed the other flags, and changed UnifiedBar to false.

@Charlizsz
Copy link

Charlizsz commented Jun 19, 2021 via email

@hacker1024
Copy link

Is there a way to do this on Big Sur with Safari Technology Preview 14.2 (126)? This method doesn't seem to work.

@Jean-Daniel
Copy link

I really doubt there is something that can be done on Big Sur.

+[FeatureAvailability isUnifiedBarEnabled]:
push       rbp
mov        rbp, rsp
mov        eax, 0x1
pop        rbp
ret

@rightones
Copy link

It seems not working from 12.0 Beta 2.

@drewfrank
Copy link

@Jean-Daniel How did you generate that assembly? I wonder if there's a way to make a one-bit binary patch to disable the feature.

@Jean-Daniel
Copy link

Jean-Daniel commented Jun 30, 2021

Any disassembler will do the job.

xcrun llvm-objdump --dis-symname="+[FeatureAvailability isUnifiedBarEnabled]" --source Safari\ Technology\ Preview.app/Contents/Frameworks/Safari.framework/Safari

It's quite easy to write a patch, but it will require to re-sign all "Safari Tech Preview" frameworks and binaries. For an app that is updated every 2 weeks and for which a new patch will be required each time, I'm not sure this is worth it.
Especially as Apple is free to completely remove this escape hatch at any time.

@mykamel
Copy link

mykamel commented Jun 30, 2021

Is there someway to unlock /System/Library/FeatureFlags/Domain/Safari.plist and edit it directly ?

@alderete
Copy link

alderete commented Jul 8, 2021

@mykamel That's kind of the point of everything in /System these days, that it's read-only except by Apple. If it's not on the locked system volume, you could probably do it, but it's a terrible idea. Follow the instructions instead.

@mykamel
Copy link

mykamel commented Jul 8, 2021

@alderete Thanks for the reply, but the instructions no longer work on DP2.

@ToniWonKanobi
Copy link

Is there a way to do this on Big Sur with Safari Technology Preview 14.2 (126)? This method doesn't seem to work.

Did you get this working with STP?

@hacker1024
Copy link

The old layout is now the default in the latest Tech Preview and Monterey Beta. It can be changed to the single-row layout in the preferences.

@ToniWonKanobi
Copy link

The old layout is now the default in the latest Tech Preview and Monterey Beta. It can be changed to the single-row layout in the preferences.

This is random, but do you know if it is possible to move the Bookmarks Bar to above the Tab Bar?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment