Fullscreen For Safari Mac



Did you know that Apple rolled out support for the Fullscreen APIon iPad Safari last fall? Well, if you didn’t you do so now. 🙂

Safari

Float a video window from Safari over your desktop or a full-screen app on your Mac or iPad. Play the video in any corner of the desktop and resize it to see more or less of what’s behind it. So you can watch videos while you browse photos. Or catch up on your favorite show while you catch up on email. Hit Command-Control-F to move in and out of fullscreen mode. Private, keep out. Hit Command-Shift-N to open a Private Browsing window.

What this means is that developers can now create fully immersive web applications for the users on the iPad. It removes every distraction on the screen reliably to help the user focus on the task/content at hand—just like a native app would—and yet it allows them to get away if they wanted to by escaping fullscreen mode.

Meaning, more freedom and better accessibility features of the web! Personally, I think that this is a huge win for the web. It is particularly useful for those of us who use an iPad as their “go to” device for surfing at night. 🤘

While there are some issues in the current implementation of the fullscreen api on iPad Safari, that we will get into shortly, this update from Apple has been nothing short of a bonus for our startup. We built fullscreen capability right into Bubblin’s Superbooks for the book-lovers on our site.

The following blogpost explains how we implemented it.

Before we start let’s take a look at the current level of vendor support for the fullscreen api:

Update: As of 1st March, 2019 most bugs around escaping fullscreen mode have been resolved by Apple.

As you can see from Caniuse nearly all major browsers on the desktop and Android devices have had some level of support for the fullscreen API, and now the iOS Safari doesn’t show the latest information too has a decent level of support. This feature was released on iOS 12.0 Safari (Now iPadOS Safari) barely a few days ago and as of November 4th, 2018 March 1st, 2019 Caniuse still doesn’t reflect the changes yet. Hopefully, it will be updated soon! Updated.

Aside from familiar vendor prefixes, and varying method names and a few other minor inconsistencies across implementations, it doesn’t take much to be able to start using the fullscreen api on the iPadOS Safari.

Here’s how I implemented using vanilla javascript:

First, define a named function _toggleFullScreen that lets you toggle between fullscreen and url mode:

This _toggleFullScreen function takes care of all the vendor prefixes and browser quirks across the spectrum. Now we just have to find out which device, browser, and iOS version the user is on to enable the fullscreen functionality for them. We have to determine if the user is (1) on the iPad and (2) using the Safari browser, and (3) if the browser they are on is iOS 12 or higher already. All of that.

Fortunately (or unfortunately) the vendor sniffing technique comes to the rescue:

We tested the code above on quite a few browsers on the iPad, but vendor sniffing, as you might already know, is an inefficient-cumbersome-avoid-as-much-as-you-can solution.

Going forward I expect more browsers on the iPad to support fullscreen api (maybe iPadOS Google Chrome will be next?) or that they will be ruled out using vendor sniffing. Given that support for fullscreen api on tablets will only improve over time, we can easily revisit the sniffer code above until this progressive enhancement melts into broader support.

To see the above code working open a Superbook on your iPad, turn a few pages and go fullscreen (menu on bottom right under three dots).

[ Image credit: The Solar System ]

Here are a few sample userAgent strings that I used to identify browsers on the iPad:

iPad Safari:

Firefox Original:

Firefox Focus:

…and so on.

On the CSS side you may not have to make any changes, but there are few options to consider depending on your situation:

That’s it.

You now have a web-app that can easily go fullscreen on the iPad Safari and people can enjoy it like a standalone/native app without needing to add to the homescreen. Again, I think this is a huge win for the web and you might want to take advantage of it for your app.

Written by: Marvin Danig, I’m the CEO of Bubblin Superbooks but I also love to code. Follow me on Twitter for more!

Credits: Special thanks to Sonica Arora (@sonicaaaaaa) and Abbey Rennemeyer (@abbeyrenn), Editor of freeCodeCamp for all the editing help on this article.

P.S.: It’s likely that some of you read this article on your desktop. I recommend revisiting on your iPad. It’s about post-PC era you know. 🙈

We built Safari to be the best browser for your Mac, iPhone, and iPad. Built-in privacy features keep your browsing your business. You can stream and search smarter with handy tools that help you save, find, and share your favorite sites. Apple Pay in Safari lets you shop safely and simply. Safari for Mac is faster and more energy efficient than other browsers. And thanks to iCloud, Safari works seamlessly with all your devices.

Defending your online privacy and security.

Privacy and security aren’t just something you should hope for — they’re something you should expect. That’s why features to help protect your privacy and keep your Mac secure are built into Safari.

Intelligent Tracking Prevention.

Remember when you looked at that green mountain bike online? And then saw annoying green mountain bike ads everywhere you browsed? Safari uses machine learning to identify advertisers and others who track your online behavior, and removes the cross‑site tracking data they leave behind. So your browsing stays your business. And Safari keeps embedded content such as Like buttons, Share buttons, and comment widgets from tracking you without your permission. We know you’ll like that.

Sandboxing. Built-in protection for websites.

Sandboxing provides a safeguard against malicious code and malware by restricting what websites can do. And because Safari runs web pages in separate processes, any harmful code you come across in one page is confined to a single browser tab, so it can’t crash the whole browser or access your data.

Fingerprinting defense.

When you’re online, the characteristics of your device can be used by advertisers to create a “fingerprint” to follow you. Safari thwarts this by only sharing a simplified system profile, making it more difficult for data companies to identify and track you.

Protection from harmful sites.

Safari helps protect you against fraudulent websites and those that harbor malware — before you visit them. If a website looks suspicious, Safari prevents it from loading and warns you.

Private Browsing.

When you use Private Browsing, Safari doesn’t remember the pages you visit, your search history, or your AutoFill information. You can also use DuckDuckGo, a built-in search engine that doesn’t track you, to make your web searches private, too.

More secure and convenient passwords.

Safari works hard to make sure your passwords are robust and unique by automatically creating and storing strong passwords for you. Once stored, your passwords will autofill in websites across all your Apple devices and in apps on iOS and iPadOS devices. In Safari preferences, passwords that have been used more than once are flagged so you can easily update them. And one-time security codes sent over SMS are autofilled right in the password field as soon as they appear in Messages. Security has never been so user friendly.

Surf seamlessly across all your devices.

Not only does Safari come on every Mac, it comes on all your iOS and iPadOS devices. And thanks to iCloud, your passwords, bookmarks, history, tabs, and Reading List are always up to date no matter which device you’re using.

iCloud Keychain securely stores your user names, passwords, and credit card numbers and keeps them up to date on your trusted devices. So you can easily sign in to your favorite websites — as well as in apps on iOS and iPadOS — and quickly make online purchases. And everything is protected with robust 256-bit AES encryption.

With Bookmarks in Safari, your favorite sites are always close at hand. Bookmark a web page on your Mac, and it automatically appears on all your iCloud-connected devices.

With Tab view, the last websites you had open on your Mac are available in Safari on your iOS and iPadOS devices — and vice versa. So you can go from one device to another without having to search for the web pages you were reading.

Save web pages you want to read later simply by adding them to your Reading List. Then view them on any of your iCloud-connected devices — even if you’re not connected to the internet.

The fastest way to browse on a Mac. And faster than any Windows browser, too.

With a blazing-fast JavaScript engine, Safari is the world’s fastest desktop browser, outperforming both Mac and PC browsers in benchmark after benchmark on the same Mac.1

JavaScript performance on advanced web applications1

Safari vs. Windows 10 browsers

Safari vs. Windows 10 browsers

Safari vs. Windows 10 browsers

Search more. Stream more.

Safari is optimized specifically for Mac, so it’s more efficient than other browsers on macOS. And Safari plays HTML5 video — the format used by your favorite streaming services — whenever it’s available. So you can explore the web for up to three hours longer and stream video for up to four hours longer than on any other browser.2

browsing compared to Chrome and Firefox

streaming videos compared to Chrome and Firefox

The best browsing experience.

Safari Full Screen Ipad

Features in Safari help you surf smarter and easily manage and share what you find.

Pay easily and securely with Apple Pay. Apple Pay is the easiest and most secure way to pay when shopping in Safari. Look for Apple Pay on your favorite shopping sites, then complete your purchase with Face ID or Touch ID on your iPhone or iPad. You can also use Touch ID on your MacBook Pro or MacBook Air, or double-click the side button on your Apple Watch. Your credit card details are never shared when you use Apple Pay, and your transactions are protected with industry-leading security.

Learn more about Apple Pay

Updated start page. Easily and quickly access your favorites and frequently visited sites. And Siri suggestions surface bookmarks, links from your reading list, iCloud Tabs, links you receive in Messages, and more.

Desktop-class browsing on iPad. Safari now shows you a website’s desktop version that’s scaled for the large iPad display and automatically optimized for touch input. Faster and more fluid scrolling makes browsing feel better than ever. And a new download manager means you can easily download and share files right in Safari.

Stop auto-play videos. Safari prevents unexpected and unwanted videos with audio from automatically playing while you browse. Just click the play button if you want to view them. Have a favorite site where you always want videos to play? Use per‑site settings in Safari to enable media auto-play.

Turn on website icons in tabs in Preferences to easily see what you have open. Pin your favorite sites and they’ll reappear in tabs every time you open Safari. You can also mute the audio on any tab right from the Smart Search field — perfect for stopping the music without having to hunt for where it’s coming from or, if you prefer, silencing all the audio from your browser at once.

Personalize your browsing experience in Safari with settings for individual websites, like page zoom level, location services, and content blockers. So each website appears just how you like it.

Automatically use Reader for every web article that supports it, so you can read without ads, navigation, and other distractions. Customize your view by selecting your font size and style, and choose Sepia and Night themes.

Mac Fullscreen Hotkey

Play video from a web page to your TV with Apple TV — without showing everything else on your desktop. Just click the AirPlay icon that appears on compatible web videos and you can watch your video on the big screen.

Float a video window from Safari over your desktop or a full-screen app on your Mac or iPad. Play the video in any corner of the desktop and resize it to see more or less of what’s behind it. So you can watch videos while you browse photos. Or catch up on your favorite show while you catch up on email.

With Spotlight built into every Mac, you’re never far from the information you want. As you type in the Smart Search field, you’ll see Safari suggestions from sources like Wikipedia, news sites, Maps, movie listings, flight status, weather, stocks, and sports.3

Share anything you come across on the web without leaving Safari. Just click the Share button, then choose how you want to send it off. Use Mail, Messages, or AirDrop or add it to a note.

Developers

Deep WebKit integration between Mac hardware and macOS allows Safari to deliver the fastest performance and the longest battery life of any browser on the platform, while supporting modern web standards for rich experiences in the browser. WebKit in macOS Catalina includes optimizations and support for additional web standards that enable even richer browsing experiences.

Fullscreen Safari Mac

Extensions

Safari Extensions are a great way to customize your browsing experience on macOS. Find and add your favorite extensions from the Mac App Store.