Adjust touch bar in Safari full screen mode

Hi everyone,
is there a way to check if Safari is currently in full screen mode (e.g. Netflix, YouTube, etc.) and adjust the touch bar accordingly?

I would like to change some buttons when when I'm entering full screen mode compared to when I'm just browsing in Safari.

I'm not sure if there's a way to identify that. However, for sites like YouTube (not sure of others) which supports keyboard shortcuts (F in YouTube goes fullscreen), perhaps you can create a TB button to trigger fullscreen and also open another group related to YouTube.

Actually, the currently playing player is available as a variable for use in CAGs. That, however only will list the app name ie Safari not the site name. But you can combine it with the window title and create conditions when Netflix is playing and when YouTube is playing. I understand that will tie it to the video being played as opposed to video being played fullscreen but it's a start! hope somebody else chimes in with info on whether we can detect a fullscreen video.

2 Likes

Totally possible!
The easier way would be though to just add a Conditional Activation Group for these Websites that would set Safari automatically to enter the fullscreen once you visit them and open the Touch Bar group you wish :man_shrugging:t4:

I think OP needs to detect the full screen video playing inside Safari and not just the safari window going full screen. Like differentiate between YouTube and YouTube full screen.

Then the solution would probably be to use a "Named & Other Triggers" with an associated Apple Script that checks if Safari runs fullscreen, and depending on this result open or not another Touch Bar group.

tell application "System Events" to tell process "Safari"
	if value of attribute "AXFullScreen" of every window is true then
		--Put Whatever Action you want to have here
	end if
end tell

If he is interested wether the player (so basically the video) and not the Application is running fullscreen, than your method above is indeed the better one.

1 Like

Yeah, I think the video player is what he needs. And my solution is still incomplete as we can only determine that Safari is playing a video and the site is YouTube or Netflix, we still can’t detect whether the video is full screen. As a workaround, I think the only way is to trigger the video to go full screen using touchbar itself. F does that in YouTube which I use but can’t be sure of other sites.

Thank you both for the suggestions! I think I'll try using a CAG with the player name. Having the additional full-screen condition would be a nice add-on, but the now playing conditions are already fulfilling the purpose :slight_smile: