Skip to content

Instantly share code, notes, and snippets.

@zhuowei
Created June 15, 2021 02:02
Show Gist options
  • Select an option

  • Save zhuowei/8ad1dd478df0efeb67baf2088e5cd85e to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown

Hi. I‘ve followed the instruction on my MacBook which running the latest macOS beta but its not useful, do I need some other steps?
截屏2021-06-18 上午5 22 28

@prausch

prausch commented Jun 18, 2021

Copy link
Copy Markdown

Looks like your file is in your Users preferences, not the /Library/Preferences

@Charlizsz

Charlizsz commented Jun 19, 2021 via email

Copy link
Copy Markdown

@hacker1024

Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown

It seems not working from 12.0 Beta 2.

@drewfrank

Copy link
Copy Markdown

@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

Jean-Daniel commented Jun 30, 2021

Copy link
Copy Markdown

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

mykamel commented Jun 30, 2021

Copy link
Copy Markdown

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

@alderete

alderete commented Jul 8, 2021

Copy link
Copy Markdown

@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

mykamel commented Jul 8, 2021

Copy link
Copy Markdown

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

@ToniWonKanobi

Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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