Safari User Guide

  • Get started
  • Go to a website
  • Get highlights
  • Bookmark webpages to revisit
  • See your favorite websites
  • Use tabs for webpages
  • Hide distractions when browsing
  • Apple Pay in Safari
  • Apple Pay in third-party browsers
  • Autofill credit card info
  • Keep a Reading List
  • Hide distractions when reading
  • Translate a webpage
  • Hide distractions when watching videos
  • Download items from the web
  • Add passes to Wallet
  • Save part or all of a webpage
  • Print or create a PDF of a webpage
  • Interact with text in a picture
  • Change your homepage
  • Customize a start page
  • Create a profile
  • Block pop-ups
  • Make Safari your default web browser
  • Hide your email address
  • Manage cookies
  • Clear your browsing history
  • Browse privately
  • Prevent cross-site tracking
  • See who tried to track you
  • Change Safari settings
  • Keyboard and other shortcuts

safari javascript dev tools

Use the developer tools in the Develop menu in Safari on Mac

If you’re a web developer, the Safari Develop menu provides tools you can use to make sure your website works well with all standards-based web browsers.

If you don’t see the Develop menu in the menu bar , choose Safari > Settings, click Advanced, then select “Show features for web developers.”

Open Safari for me

  • Save BIG on Big Deal Days!
  • Apple Fans: Grab Early Prime Day Deals!

How to Activate the iPhone Debug Console or Web Inspector

Use Safari's web developer tools to study problematic websites

safari javascript dev tools

  • Saint Mary-of-the-Woods College
  • Switching from Android

What to Know

  • Activate Web Inspector on iOS: Go to Settings > Safari > Advanced and move the Web Inspector toggle switch to the On position.
  • Use Web Inspector on macOS: Connect your iOS device to a Mac and choose the URL to inspect from the Develop menu.

If you run into a bug or another issue with a website on Safari mobile, use the Web Inspector tool to investigate. This article explains how to use the Safari console for iPhone to debug errors with the help of your Mac computer. Instructions apply to iPhones with iOS 14, iOS 12, or iOS 11, and well as Macs with macOS Big Sur (11.0), macOS Catalina (10.15), or macOS Mojave (10.14).

Activate Web Inspector on Your iPhone or Other iOS Device

The Web Inspector is disabled by default since most iPhone users have no use for it. However, if you're a developer or you're curious, you can activate it in a few short steps. Here's how:

Open the iPhone  Settings  menu.

On an iPhone with an early version of iOS, access the Debug Console through Settings > Safari > Developer > Debug Console . When Safari on the iPhone detects CSS, HTML, and JavaScript errors, details of each display in the debugger.

Scroll down and tap  Safari  to open the screen that contains everything related to the Safari web browser on your iPhone, iPad, or iPod touch.

Scroll to the bottom of the page and select Advanced .

Move the Web Inspector toggle switch to the On position.

Connect Your iOS Device to Safari on a Mac

To use the Web Inspector, connect your iPhone or another iOS device to a Mac that has the Safari web browser and enable the Develop menu .

With Safari open, select Safari from the menu bar and choose  Preferences .

Select the  Advanced  tab.

Select the Show Develop menu in menu bar check box and close the settings window.

From the Safari menu bar, select Develop and choose the name of your attached iOS device, then select the URL that appears under Safari to open the debug console for that site.

After you connect your device, use your Mac to inspect the website you want to debug and have it open in the Safari mobile browser.

What Is Web Inspector?

Web developers use Web Inspector to modify, debug, and optimize websites on Macs and iOS devices. With Web Inspector open, developers can inspect the resources on a web page. The Web Inspector window contains editable HTML and notes regarding the styles and layers of the web page in a separate panel.

Before iOS 6, the iPhone Safari web browser had a built-in Debug Console that developers used to find web page defects. Recent versions of iOS use Web Inspector instead.

With Safari 9 and OS X Mavericks (10.9), Apple introduced Responsive Design Mode in Web Inspector. Developers use this built-in simulator to preview how web pages scale to different screen sizes, resolutions, and orientations.

To set up Web Inspector on your iPad, open your iPad's Settings and select Safari > Advanced , then turn Web Inspector On . Connect the iPad to a Mac computer, then open Safari on the Mac and select Safari > Preferences > Advanced , then turn on Show Develop menu in menu bar .

You cannot just connect your iPhone to a Windows PC and start using Web Inspector through Chrome like you can with a Mac. Installing package manager software can provide you a sort of workaround, but it's not recommended unless you're familiar with the package management app you intend to use.

Get the Latest Tech News Delivered Every Day

  • How to Screen Record on iPhone 13
  • How to Turn Off the Flashlight on an iPhone 12
  • How to Use Voice Control on iPhone and iPod Touch
  • How to Set up and Use Focus Mode on iPhone and Apple Watch
  • How to Turn Off SOS on an iPhone 15
  • How to Activate Incognito Mode in Chrome for iPhone, iPad, and iPod Touch
  • How to Turn Off Do Not Disturb on iPhone 14
  • The 10 Best iPhone Hacks & Tips for 2024
  • How to Unlock iCloud-Locked iPhones
  • How to Fix it When Optimized Battery Charging is Not Working on iPhone 13
  • Do These 12 Things First When You Get a New iPhone
  • How to Turn Off SOS on an iPhone 14
  • iPhone Focus Mode: What It Is and How to Use It
  • How to Fix Could Not Activate Cellular Data Network Error
  • Where to Buy an iPhone
  • How to Get Your iPhone to Announce Calls

daily.dev platform

Discover more from daily.dev

Personalized news feed, dev communities and search, much better than what’s out there. Maybe ;)

Safari Browser Tips for Developers

Safari Browser Tips for Developers

Tips and techniques for developers using Safari browser, including enabling developer tools, inspecting and modifying code, debugging, performance optimization, responsive design, and more.

If you're developing for Apple devices, mastering Safari's developer tools is essential. Here 's a quick guide to get you started:

  • Enable Developer Tools in Safari by accessing Preferences > Advanced and checking 'Show Develop menu in menu bar'.
  • Web Inspector helps you inspect and modify HTML, CSS, and JavaScript in real-time.
  • Responsive Design Mode allows you to test your site on various device sizes.
  • Debugging Tools like the Console and Network panels aid in identifying and solving coding issues.
  • Performance Optimization techniques help you speed up your website.
  • Accessibility and Security features ensure your site is usable and safe for all users.
  • Safari-specific tips include detecting the browser, optimizing media encoding, and implementing responsive design .
  • Advanced Debugging Techniques offer deeper insights into your code's behavior.

This guide aims to improve your efficiency and effectiveness when developing web applications or sites for Safari, ensuring a smooth and optimized user experience across all Apple devices.

Navigating the Developer Tools Interface

Safari's developer tools interface provides comprehensive inspection and debugging capabilities through several key panels:

Elements Panel

The Elements panel allows you to inspect and modify the DOM tree and CSS styles associated with the loaded webpage. You can:

  • View and edit HTML elements and attributes
  • Modify CSS styles directly in the panel
  • Visualize box models, positioning, and other layout details
  • Identify accessibility issues

The Elements panel is extremely useful for tweaking designs and layouts, fixing styling issues, and understanding DOM structure.

Network Panel

The Network panel logs all network requests made by the page and provides insights into loading performance. You can:

  • View all assets loaded by the page like scripts, stylesheets, images
  • Check request and response headers
  • Identify slow network requests impacting page load speed
  • See a breakdown of total download size and time

This is helpful to optimize page load times and identify network bottlenecks.

Sources Panel

This panel allows debugging and modification of JavaScript code. You can:

  • Pause code execution to step through your script
  • Set breakpoints and inspect variable values
  • Edit JavaScript code on the fly
  • Profile memory usage and CPU activity

The Sources panel is great for identifying and fixing JavaScript bugs and performance issues.

Timelines Panel

The Timelines panel visualizes various events tied to loading and running a webpage over time, including:

  • Resource loading
  • Style calculations
  • Layout changes
  • Script activity
  • Rendering frames

Analyzing these timelines is crucial to pinpoint expensive operations that may cause jank or lag when interacting with your site.

Console Panel

The Console panel logs output from JavaScript code running on the page, any runtime errors, logging statements, network request statuses, and more. This can help identify and debug a wide variety of front-end issues.

Storage Panel

This panel allows inspection and modification of all browser storage mechanisms utilized by the page like cookies, local storage, session storage, and more. It is invaluable for understanding and debugging client-side data persistence.

Overall, Safari's developer tools provide unparalleled inspection and debugging capabilities for webpages. Mastering these tools is essential for any web developer looking to build high-quality experiences.

Inspecting and Modifying HTML and CSS

Selecting elements.

To pick an element to work on in the Elements panel:

  • Just click on the part of the webpage you're interested in. This makes it pop up in the Elements panel.
  • Or, click on the element's name in the DOM tree in the Elements panel.

Other ways to find elements include:

  • Use the search box to look for elements by their ID, class name, or tag name.
  • Right-click on an element and choose "Select Element in Console" to use it in Console commands.

When you choose an element, you'll see all its details like HTML, CSS, and layout info on the right side.

Editing HTML

To change the HTML of something you've selected:

  • Double-click on its tag or text in the Elements panel.
  • Or right-click and pick "Edit as HTML".

Now, you can edit the HTML. Press Enter when you're done to save your changes.

Some quick tips:

  • Switch tag names to change the structure.
  • Change attributes like id or class .
  • Add, tweak, or remove child elements.

Your webpage will update right away with your changes.

Modifying CSS Styles

To change the CSS styles of something:

  • Click on the element in the Elements panel or on the webpage.
  • On the right, in the Styles section, find the style you want to change.
  • Click in the value box, make your edit, and press Enter.

You can also:

  • Hit the New Style Rule button ( + ) to add new styles.
  • Toggle style properties on or off by checking/unchecking them.
  • Right-click on a style to make it !important or to copy it.

Like before, your webpage shows the changes right away.

Adding and Removing Classes

You can change how an element looks and acts by adding or removing classes.

To add a class:

  • Choose the element in the Elements panel.
  • Look for the class attribute in the Attributes section.
  • Type in the new class name. Use spaces to add more than one.

To get rid of a class, just delete its name from the class attribute.

This is a quick way to change an element's style without messing with CSS rules directly.

Utilizing the Web Inspector for Debugging

The Web Inspector is a super handy tool for checking out how your page looks, fixing JavaScript problems, and figuring out what slows things down. Here's how to make the most of it:

Inspecting Page Layouts

  • The Elements panel lets you peek at the structure of your webpage and see how elements are laid out.
  • You can turn CSS styles on and off to immediately see how they affect your page.
  • Experiment with layout by changing styles like width , height , margin , and so on.
  • The Layout pane helps you spot issues with how things are arranged on your page.

Debugging JavaScript

  • Use the Sources panel to pause your code where you want and go through it step by step.
  • Check out variables, events, and what the code is doing at each step on the side.
  • Change code on the fly, run small tests, and look at values in the Console .
  • Find out where your code is slow or using too much memory.

Analyzing Network Performance

  • The Network panel shows you everything your page is loading.
  • Find out which parts take the longest to load.
  • Look at the details of what's being sent and received.
  • Pretend you're on a slower connection to see how your page does.

Diagnosing Rendering Issues

  • Use the Timelines panel to see everything that happens when your page loads and runs.
  • Look for parts of your page that make it slow or choppy.
  • Record what happens when people use your page to find spots you can make better.

Getting good at using Safari's Web Inspector means you can make your websites work better and faster. It's all about spotting problems and fixing them.

Responsive Design Mode

Responsive Design Mode is a feature in Safari that lets you see how your website looks on different devices like phones, tablets, and computers. It's great for making sure your site works well no matter what screen size someone is using. Here's a simple guide to using it:

Enabling Responsive Design Mode

To start using Responsive Design Mode in Safari:

  • Go to the Develop menu at the top.
  • Choose Responsive Design Mode from the list.

A toolbar will show up with different screen sizes you can test.

Selecting Screen Sizes

In Responsive Design Mode, you can pick from preset screen sizes for devices like:

  • Or even specific sizes like 1440px wide

Just click on one to see how your site looks. You can also manually adjust the size by dragging the corner of the window, switch to landscape mode, or simulate using a touchscreen.

Testing Responsiveness

As you change the size of the Safari window:

  • Move around your site to see if it adjusts smoothly.
  • Check that things like text and images move or resize correctly.
  • Make sure links and buttons work as expected.

This helps you spot any parts of your site that might not look right on different screens, like if text gets too squished or a picture disappears.

Integration with Web Inspector

You can use Responsive Design Mode together with Safari's Web Inspector. This means you can:

  • Look closely at the code of your site and change it on the fly.
  • Solve problems with your site's JavaScript.
  • Check how fast your site loads and find ways to make it faster.

Using these tools together can help you make sure your site not only looks good on all devices but also works well and loads quickly.

By getting good at using Responsive Design Mode, you can make websites that everyone can enjoy, no matter what device they're using. It's a good idea to test your site often as you build it to catch any issues early.

Advanced Debugging Techniques

Debugging web apps can sometimes feel like a puzzle, but Safari's got some cool tools to help you out. Here are some tips to step up your debugging game with the Web Inspector:

Using the Debugger Statement

You can make your JavaScript take a break by adding debugger; in your code. When Safari sees this, it'll pause right there, letting you take a closer look.

How to do it:

  • Jump into the Sources panel
  • Drop debugger; into the line where you want things to pause
  • Refresh the page
  • Your code will stop at that line, ready for you to dive in

This is super handy for checking out what's happening at certain moments.

Viewing Console Logs

The Console panel is where you'll see messages from console.log() , along with any errors or warnings.

  • Use console.log() to spit out what values variables are holding or to track where you are in your code.
  • You can sift through messages by type, like error or warn , to zero in on problems.
  • Logging objects? You can peek inside them with console.log(someObject);

Filtering Network Traffic

In the Network panel, you can narrow down requests by:

  • Type (like XHR, JS, CSS)
  • Where they're from (domain)
  • How big they are
  • How long they take

This is great for digging into specific stuff, like if you're only interested in checking out API calls.

Analyzing Detailed Timelines

The Timelines panel lays out everything that happens as your page loads and runs, all on a neat timeline.

What you can do:

  • Zoom in to get a closer look at certain actions
  • Filter by types of events
  • Look up specific elements or actions
  • Check out the details of what's causing delays

This helps you find and fix spots that slow your app down.

  • Pause your code with debugger; to take a closer look at specific spots
  • Use console.log() to keep tabs on what your code is doing
  • Filter network stuff to focus on what matters to you
  • Use the timelines to spot and smooth out any slow parts

Getting the hang of these tricks will help you make smoother, faster web apps.

Safari-specific Development Tips

Detecting safari browser.

You can find out if someone is using Safari and what version it is with this bit of code:

Then, you can make your website work differently depending on the Safari version:

This way, your website can work well for everyone, no matter what version of Safari they're using.

Supporting Multiple WebKit Versions

Since Safari uses the WebKit engine, you can check if certain WebKit features are available:

And use -webkit- in your CSS for things to look right in both old and new versions of WebKit:

Checking the WebKit Feature Status helps you know what's supported.

Optimizing Media Encoding

For videos, use MP4 format with H.264 encoding. For audio, MP3 works well across browsers. Use <video> and <audio> tags for media on your website. For drawings or animations, <canvas> works great in Safari. Using these formats makes sure your website loads fast and looks good in Safari.

Implementing Responsive Design

Use flexible layouts, images that resize, and media queries for a website that looks good on any device:

Always check how your site looks on different devices like iPhones, iPads, and desktops to make sure everything adjusts and fits well.

Adding Multi-Touch Support

Make your website interactive for touch devices by listening to touch events:

You can detect different gestures like taps, swipes, or pinches and use them to make things move or change on your site. This makes your website more fun and easier to use on phones and tablets.

sbb-itb-bfaad5b

Simulating devices and screen sizes.

Safari lets you check how your website looks on different devices and screen sizes right from your computer. This is super helpful for making sure your site looks good whether someone is viewing it on a phone, tablet, or computer.

To get started:

  • Click on Develop > Responsive Design Mode in the Safari menu.
  • You'll see a toolbar with different device and screen size options.

Selecting Emulation Options

In Responsive Design Mode, you can:

  • Pick from devices like iPhone, iPad, Apple Watch
  • Choose screen sizes like 1440x900 or 1280x720
  • Try out portrait/landscape views
  • Test how touch input works

Just click on a device or screen size to see how your page changes.

Customizing Sizing

You can also manually adjust the size of the page by dragging the window's edges, or you can type in specific sizes:

And you can switch between landscape and portrait modes:

As you change sizes, make sure that:

  • Your page adjusts smoothly for different screen sizes
  • Pictures and videos fit well and don't stick out
  • Text is easy to read and everything is easy to use

Scrolling around helps you check that everything moves right.

Integration with Developer Tools

You can use Responsive Design Mode with other tools in Safari like the Web Inspector. This lets you do a lot at once, like:

  • Look at and change your site's code
  • Figure out JavaScript issues
  • Check how fast your site is
  • Find and fix display problems

This makes it easier to get your site looking and working great on all devices.

Achieving Consistency

Test your site on different screens as you build it to make sure it always works and looks right.

  • Start emulation with Develop > Responsive Design
  • Use the preset options for devices and screen sizes
  • Adjust the page size yourself if needed
  • Test your site with other Safari tools for a complete check-up
  • Keep testing on different screens to make sure your site stays responsive

Following these steps will help make sure your site offers a good experience for everyone, no matter what device they're using.

Debugging Safari Web Apps on macOS

When you're working on a web app for Safari on a Mac, you'll need to know how to find and fix problems. Here's a simple guide to get you started with Safari's built-in tools for developers.

Enabling Web Inspector

First things first, you need to turn on a tool called Web Inspector:

  • Go to Safari's preferences and click on the Advanced tab
  • Make sure the box next to "Show Develop menu in menu bar" is checked
  • You'll see a new "Develop" menu appear at the top of Safari
  • From there, select "Show Web Inspector"

You can also press Option + Command + I on your keyboard to open it up quickly.

Inspecting the Web App

With Web Inspector open, you can:

Use the Elements panel to look at the website's building blocks (HTML) and how it's styled (CSS). This is great for checking the layout, seeing what styles are applied, and making sure it's accessible.

The Console panel shows you errors or any messages from your JavaScript. This helps you spot problems fast.

The Sources panel lets you dive into your JavaScript code. You can pause it, see what's happening step by step, and check out the values of different things while it runs.

The Network panel keeps track of all the files your app is loading. It's useful for finding out if anything is taking too long to load.

Check out the Timelines and Profiles panels to see if there are any slow parts in your app causing delays or making things choppy.

Testing on Different Devices

You can see how your app looks on different devices using a feature called Responsive Design Mode. Just go to the Develop menu and turn it on. This lets you check if your app looks good on phones, tablets, and computers without having to test it on each device.

Modifying Code

With Web Inspector, you can change your app's HTML, CSS, and JavaScript right there and then. This means you can try out new ideas quickly:

  • Change the text or structure in the Elements panel
  • Adjust how things look by tweaking the CSS
  • Update your JavaScript in the Sources panel

Just refresh your app to see how the changes work out.

Achieving Performance

Use Web Inspector to look at how your app loads and runs. You can find out what's slowing it down and fix it by:

  • Looking at network requests to see if files are too big or slow to load
  • Checking JavaScript performance to find and fix slow code
  • Watching for layout changes that might be causing delays

Testing your app in different situations helps make sure it runs smoothly for everyone.

Performance Optimization

Detecting unused code.

To spot CSS and JavaScript your web app doesn't really use, follow these steps in your browser's developer tools:

  • Open the developer tools and find the Coverage panel.
  • Refresh your page with the coverage tool running - this keeps track of which bits of code are active.
  • Use your site to make sure you're checking all its features.
  • Look at the Coverage panel to see how much of your code was actually needed.
  • Click on files to see parts of the code that weren't used, shown in red.
  • Get rid of code that you don't need to make your files smaller.

Some hints:

  • Hit Start instrumenting coverage to begin.
  • Try out every part of your site to catch all the code that might run.
  • Pay special attention to big CSS or JavaScript files that aren't used much.

Cutting out unnecessary code helps your site run faster and smoother.

Analyzing Resource Sizes

To look into how big your site's files are using the Network panel:

  • Open the developer tools and switch to the Network tab.
  • Refresh the site to see all the files it loads.
  • Look at the Size column for how big each file is.
  • Organize by size to spot the biggest files.
  • Click on a file for more details, like how much you could save by compressing it.
  • Files larger than 2MB can slow down your site.

Ways to make files smaller:

  • Shrink and tidy up JavaScript and CSS files.
  • Use tools to make images smaller without losing quality.
  • Only load big files when they're actually needed.

Making your files leaner can make your site load faster and work better.

Accessibility and Security

Making sure websites are easy to use and safe is really important, especially for people using iPhones and iPads. Here are some tips for making websites better for everyone in Safari:

Implementing Proper Accessibility

  • Use special codes ( ARIA roles, states, and properties) to help browsers understand what each part of your website is supposed to do.
  • Always provide descriptions for images and other non-text content.
  • Make sure there's a strong contrast between text and its background so it's easy to read.
  • Design your site so people can navigate through it using just a keyboard.
  • Make your site work well with tools that help people with disabilities, like screen readers.

Tips for testing:

  • Try using VoiceOver on iOS to check if people can listen to your website's content.
  • Use the Accessibility Inspector in Safari to make sure everything's set up right.

Utilizing Safari's Security Features

  • Use HTTPS to keep connections to your site secure.
  • Make sure any external content on your site hasn't been messed with.
  • Think about using Feature Policy for tighter control over your site's features.
  • Use Credential Management API to help users log in securely.

Additional measures:

  • Always clean and check any information users give you.
  • Stick to the best ways of keeping user accounts safe.
  • Be careful with scripts from other websites.

Checking for Common Issues

  • Make sure your site meets the guidelines for accessibility.
  • Look out for common security risks like XSS or CSRF.
  • Test your site on both desktop and mobile versions of Safari.
  • Check that your site still works when Safari's extra security settings are turned on.

Focusing on making your site easy to use and safe helps everyone have a better experience. Testing thoroughly is the best way to find and fix any problems.

Safari gives developers a lot of tools to make websites and apps work really well on Apple devices. If you know how to use these tools, you can make your site or app faster, look better, and be easier for everyone to use.

Here's a quick recap of what we talked about:

  • Develop menu in Safari lets you use cool tools like Web Inspector for checking and fixing code, and Responsive Design Mode for seeing how your site looks on different devices.
  • The Elements panel helps you look at and change the website's HTML and CSS, check how it's laid out, and make sure it's accessible to everyone.
  • The Network panel helps you see how fast your site loads and find ways to make it load faster.
  • Sources panel is for finding and fixing JavaScript bugs.
  • Timelines panel shows you what happens when your page loads and helps you find parts that make it slow.
  • Responsive Design Mode lets you see how your site looks on phones, tablets, and computers.
  • Make sure your site can be used easily by everyone, including people with disabilities, by using ARIA roles and testing with tools like VoiceOver.
  • Keep your site safe with HTTPS, clean inputs, and safe login methods.

We also shared tips on how to make sure your site works well in Safari, like checking for Safari browser, using WebKit features, making your site responsive, adding touch events, and making your site fast.

With Safari being so popular on mobile devices, it's really important to test your site on Apple's devices to make sure it works great. Use the tools we talked about to check your site and keep updating it with new features.

In short, making your site work well in Safari means happy users who'll want to keep coming back.

Related Questions

How do i use developer in safari.

To turn on developer tools in Safari, follow these steps:

  • Open Safari , then go to Preferences
  • Click on the Advanced tab
  • Make sure to tick the box for Show Develop menu in menu bar
  • Now, you'll see a new Develop menu at the top, which lets you access various developer tools

These tools include the Web Inspector for checking your website's code and layout, Responsive Design Mode for seeing how your site looks on different devices, and a console for solving JavaScript problems.

Is Safari good for Webdev?

Yes, Safari is great for web development. It has handy tools like Web Inspector, Responsive Design Mode, and Accessibility Inspector that make building, testing, and improving websites easier.

Since Safari uses WebKit, like some other browsers, testing for cross-browser compatibility is more straightforward. Plus, its popularity among Apple device users means it's crucial for reaching a broad audience. Safari offers a solid development environment for web professionals.

How do I use Safari efficiently?

Here are a few tips to get the most out of Safari:

  • Look at all your open tabs with tab previews and close ones you don't need by swiping.
  • Turn on Reader Mode for a cleaner reading experience on web pages.
  • Bookmark your go-to sites and use the smart search feature for quick access.
  • Use Keychain for saving and autofilling passwords securely.
  • When privacy is a concern, switch to Private Browsing mode.
  • Add useful shortcuts to your toolbar for quick access.

How do I make Safari work better?

To improve Safari's performance:

  • Clean out your browsing history and site data now and then.
  • Switch on the Develop menu for access to more tools that can help optimize your browsing.
  • Stop videos from playing automatically to save on resources.
  • Use Reader Mode on complex pages to cut down on data use.
  • Make sure privacy settings are on.
  • If content blockers are messing with a site, try turning them off temporarily.
  • Keep Safari and your operating system up to date for the latest speed and security enhancements.

Related posts

  • Download HTML Page: Step-by-Step Guide
  • Call from Browser: The Future of Developer Networking
  • Navigating Chrome Generator for Beginner Developers
  • Edge Browser Extension Essentials for Developers

daily.dev platform

Why not level up your reading with daily.dev?

Podcast Sound Design: Essential Elements, Effects & Music

How To Get Developer Tools In Safari

Copy to Clipboard

  • Software & Applications
  • Browsers & Extensions

how-to-get-developer-tools-in-safari

Introduction

Safari, the sleek and innovative web browser developed by Apple, is known for its user-friendly interface and seamless integration with Apple devices. While Safari offers a smooth browsing experience for users, it also provides powerful tools for web developers to create and optimize websites and web applications. One of the key features that sets Safari apart is its built-in Developer Tools, which offer a comprehensive set of resources for web development and debugging.

Whether you are a seasoned web developer or just starting out, having access to Safari's Developer Tools can significantly enhance your workflow and productivity. These tools enable you to inspect and modify web page elements, debug JavaScript, analyze network activity, and optimize website performance, among other capabilities. By leveraging Safari's Developer Tools, you can gain valuable insights into the structure and behavior of web pages, identify and troubleshoot issues, and fine-tune the performance of your web projects.

In this article, we will delve into the process of enabling and utilizing Safari's Developer Tools for web development. We will explore the various features and functionalities offered by these tools, providing practical insights and tips for leveraging them effectively. Whether you are a web developer, designer, or simply curious about the inner workings of websites, this guide will equip you with the knowledge and skills to harness the full potential of Safari's Developer Tools.

Let's embark on a journey to uncover the hidden gems of Safari's Developer Tools and unlock the power of web development within the confines of this innovative browser . Whether you're seeking to enhance your web development skills or gain a deeper understanding of web technologies, Safari's Developer Tools are your gateway to a world of possibilities. So, without further ado, let's dive into the realm of web development with Safari as our trusted companion.

Enabling Developer Tools in Safari

Enabling Safari's Developer Tools is a straightforward process that unlocks a treasure trove of functionalities for web development. Whether you're a seasoned developer or a curious enthusiast, accessing these tools can significantly enhance your web development experience within the Safari browser .

To enable Developer Tools in Safari, follow these simple steps:

Open Safari Preferences : Launch Safari and navigate to the "Safari" menu located in the top-left corner of the screen. From the drop-down menu, select "Preferences."

Access Advanced Settings : In the Preferences window, click on the "Advanced" tab. This will reveal a set of advanced settings for Safari.

Enable Develop Menu : Within the Advanced tab, locate the option labeled "Show Develop menu in menu bar" and ensure that it is checked. This action activates the Develop menu, which houses a plethora of web development tools and features.

Verify the Development Menu : After enabling the Develop menu, you should see it appear in the menu bar at the top of the screen, alongside other Safari menu options.

Once you have completed these steps, Safari's Developer Tools will be readily accessible, empowering you to delve into the intricacies of web development and gain valuable insights into the structure and behavior of web pages.

By enabling Developer Tools in Safari, you gain access to a suite of powerful resources that can elevate your web development capabilities. From inspecting and modifying web page elements to analyzing network activity and optimizing website performance, Safari's Developer Tools provide a comprehensive toolkit for enhancing your web projects.

With Developer Tools at your fingertips, you are poised to embark on an enriching journey through the realms of web development, armed with the tools and insights needed to create, optimize, and fine-tune captivating web experiences within the Safari browser.

Using Developer Tools for Web Development

Safari's Developer Tools offer a robust set of features and functionalities that empower web developers to streamline their workflows, troubleshoot issues, and optimize web projects. By leveraging these tools, developers can gain valuable insights into the inner workings of web pages and applications, ultimately enhancing the user experience and performance of their creations.

Inspecting and Modifying Web Page Elements

One of the fundamental capabilities of Safari's Developer Tools is the ability to inspect and modify web page elements in real time. By right-clicking on any element within a web page and selecting "Inspect Element," developers can access a detailed view of the HTML and CSS properties associated with that element. This feature is invaluable for understanding the structure and styling of web pages, allowing developers to make on-the-fly adjustments and see the immediate impact on the page layout.

Debugging JavaScript and Analyzing Console Output

Safari's Developer Tools include a robust JavaScript debugger, enabling developers to identify and resolve issues within their JavaScript code. By setting breakpoints, stepping through code, and examining variable values, developers can pinpoint and troubleshoot errors, ultimately improving the functionality and reliability of their web applications. Additionally, the console within Developer Tools provides a space for logging messages, errors, and warnings, offering valuable insights into the runtime behavior of JavaScript code.

Network Analysis and Performance Testing

Another powerful aspect of Safari's Developer Tools is the network panel, which allows developers to analyze network activity and optimize the performance of web pages. By monitoring network requests, loading times, and resource sizes, developers can identify opportunities for optimization, such as minimizing file sizes, leveraging caching strategies, and reducing unnecessary network requests. This capability is instrumental in creating fast and efficient web experiences for users across various devices and network conditions.

Modifying and Testing CSS in Real Time

Safari's Developer Tools provide a seamless environment for modifying and testing CSS styles directly within the browser. Developers can experiment with different styles, colors, and layouts, observing the immediate effects on web page elements. This real-time feedback accelerates the design and development process, allowing developers to fine-tune the visual presentation of their websites with precision and agility.

Leveraging Additional Tools and Resources

In addition to the aforementioned features, Safari's Developer Tools offer a wide array of resources, including the Elements panel for inspecting and editing the DOM, the Application panel for managing web storage and service workers, and the Security panel for identifying potential security vulnerabilities within web applications. These tools collectively provide a comprehensive toolkit for web developers, empowering them to create secure, performant, and visually compelling web experiences.

By harnessing the power of Safari's Developer Tools, web developers can elevate their skills, optimize their workflows, and deliver exceptional web experiences to users. Whether you are fine-tuning the layout of a responsive website, debugging complex JavaScript interactions, or optimizing the performance of a web application, Safari's Developer Tools are your indispensable companions in the journey of web development.

Inspecting and Debugging Web Pages

Inspecting and debugging web pages is a fundamental aspect of web development, and Safari's Developer Tools provide a robust set of features for this purpose. When it comes to understanding the structure and behavior of web pages, as well as identifying and resolving issues, the inspection and debugging capabilities within Safari's Developer Tools are indispensable.

Inspecting Web Page Elements

The ability to inspect web page elements is a cornerstone of Safari's Developer Tools. By right-clicking on any element within a web page and selecting "Inspect Element," developers can access a detailed view of the HTML and CSS properties associated with that element. This feature provides a comprehensive breakdown of the selected element, including its position, dimensions, styling, and any associated event listeners. This level of insight allows developers to gain a deep understanding of the composition and layout of web page elements, facilitating precise modifications and optimizations.

Modifying Web Page Elements in Real Time

In addition to inspecting web page elements, Safari's Developer Tools enable developers to modify elements in real time. By directly editing the HTML and CSS properties of elements within the Elements panel, developers can experiment with different styles, content, and layouts, observing the immediate impact on the web page. This real-time editing capability is invaluable for fine-tuning the visual presentation of web pages and rapidly iterating on design and layout changes.

Safari's Developer Tools include a powerful JavaScript debugger, which allows developers to identify and resolve issues within their JavaScript code. By setting breakpoints, stepping through code, and examining variable values, developers can pinpoint and troubleshoot errors, ultimately improving the functionality and reliability of their web applications. Additionally, the console within Developer Tools provides a space for logging messages, errors, and warnings, offering valuable insights into the runtime behavior of JavaScript code. This feature is instrumental in diagnosing and addressing JavaScript-related issues, ensuring the smooth execution of interactive and dynamic web elements.

In essence, Safari's Developer Tools provide a comprehensive suite of capabilities for inspecting and debugging web pages. From gaining insights into the structure and styling of web page elements to identifying and resolving JavaScript-related issues, these tools empower developers to create, optimize, and fine-tune web experiences with precision and efficiency. By leveraging the inspection and debugging features within Safari's Developer Tools, developers can elevate their skills, streamline their workflows, and deliver exceptional web experiences to users.

Modifying and Testing CSS and JavaScript

Modifying and testing CSS and JavaScript is a crucial aspect of web development, and Safari's Developer Tools offer a seamless environment for making real-time adjustments and testing code changes. Whether you're refining the visual presentation of a website or fine-tuning the functionality of interactive elements, Safari's Developer Tools provide a comprehensive toolkit for working with CSS and JavaScript.

Real-time CSS Modifications

Safari's Developer Tools allow developers to modify CSS styles directly within the browser, providing immediate feedback on the visual appearance of web page elements. By accessing the Styles panel, developers can experiment with different styles, colors, and layouts, observing the instant effects on the web page. This real-time editing capability accelerates the design and development process, enabling developers to iterate on visual enhancements with agility and precision.

Testing JavaScript Code

In addition to CSS modifications, Safari's Developer Tools facilitate the testing and debugging of JavaScript code. The JavaScript debugger within Developer Tools empowers developers to set breakpoints, step through code, and inspect variable values, facilitating the identification and resolution of JavaScript-related issues. By leveraging the debugging capabilities, developers can ensure the reliability and functionality of interactive elements, such as dynamic user interfaces and client-side interactions.

Performance Optimization

Furthermore, Safari's Developer Tools provide insights into the performance of CSS and JavaScript code. Developers can analyze the impact of CSS styles and JavaScript functions on web page loading times and responsiveness, identifying opportunities for optimization. By monitoring the execution of CSS and JavaScript, developers can fine-tune code to enhance the overall performance and user experience of web applications.

In summary, Safari's Developer Tools offer a comprehensive suite of features for modifying and testing CSS and JavaScript. From real-time CSS adjustments to JavaScript debugging and performance optimization, these tools empower developers to create visually compelling and functionally robust web experiences. By harnessing the capabilities within Safari's Developer Tools, developers can refine the presentation and behavior of web pages with precision, ensuring an exceptional user experience across various devices and platforms.

Network analysis and performance testing are critical components of web development, and Safari's Developer Tools provide a robust set of features for evaluating the network activity and optimizing the performance of web pages and applications.

Monitoring Network Activity

Safari's Developer Tools offer a comprehensive Network panel, which allows developers to monitor and analyze the network activity associated with a web page. This includes tracking network requests, such as HTTP requests for resources like HTML, CSS, JavaScript, images, and other assets. By examining the network waterfall, developers can gain insights into the timing and sequence of network requests, identifying potential bottlenecks and optimizing the loading process.

Resource Size and Loading Times

The Network panel within Safari's Developer Tools provides detailed information about the size and loading times of individual resources. Developers can assess the impact of resource sizes on web page performance, identifying opportunities to optimize assets for faster loading. By analyzing the loading times of resources, developers can prioritize critical content and streamline the delivery of essential assets, ultimately enhancing the overall user experience.

Safari's Developer Tools empower developers to optimize the performance of web pages by identifying and addressing potential performance bottlenecks. By leveraging the insights from the Network panel, developers can implement strategies to minimize file sizes, leverage browser caching, and reduce unnecessary network requests. Additionally, developers can assess the efficiency of third-party integrations and external resources, ensuring that web pages load quickly and responsively across various devices and network conditions.

Network Throttling

One of the standout features of Safari's Developer Tools is the ability to simulate different network conditions using network throttling. Developers can emulate various network environments, such as 3G , 4G, or slower connections, to assess the performance of web pages under different bandwidth constraints. This capability enables developers to optimize web pages for a wide range of network conditions, ensuring a consistent and reliable user experience for diverse audiences.

In essence, Safari's Developer Tools provide a comprehensive suite of capabilities for network analysis and performance testing. By monitoring network activity, assessing resource sizes and loading times, optimizing web page performance, and simulating network conditions, developers can create fast, efficient, and responsive web experiences. Leveraging the insights and tools within Safari's Developer Tools, developers can fine-tune the performance of web pages, ultimately delivering exceptional user experiences in the ever-evolving landscape of the web.

In conclusion, Safari's Developer Tools serve as a gateway to the intricate world of web development, offering a rich array of features and functionalities that empower developers to create, optimize, and fine-tune web experiences with precision and efficiency. By enabling and leveraging these tools, developers gain valuable insights into the structure, behavior, and performance of web pages, ultimately enhancing the user experience and functionality of their web projects.

From inspecting and modifying web page elements to debugging JavaScript, analyzing network activity, and optimizing performance, Safari's Developer Tools provide a comprehensive toolkit for addressing the diverse challenges of web development. The seamless integration of real-time editing, debugging, and performance analysis within the browser environment streamlines the development process, allowing developers to iterate on design and functionality with agility and precision.

Furthermore, the ability to simulate network conditions and assess the impact of resource sizes on web page performance equips developers with the tools needed to create fast, efficient, and responsive web experiences across various devices and network environments. This capability is instrumental in ensuring a consistent and reliable user experience, regardless of the user's location or network conditions.

By harnessing the power of Safari's Developer Tools, developers can elevate their skills, optimize their workflows, and deliver exceptional web experiences to users. Whether it's refining the visual presentation of a website, debugging complex JavaScript interactions, or optimizing the performance of a web application, Safari's Developer Tools are indispensable companions in the journey of web development.

In essence, Safari's Developer Tools not only provide a window into the inner workings of web pages but also empower developers to craft immersive, performant, and visually compelling web experiences. As the web continues to evolve, Safari's Developer Tools stand as a testament to Apple's commitment to providing developers with the resources and capabilities needed to thrive in the dynamic landscape of web development.

In the ever-expanding digital ecosystem, Safari's Developer Tools remain a steadfast ally for developers, offering a robust platform for innovation, creativity, and excellence in web development. Whether you're a seasoned developer or an aspiring enthusiast, Safari's Developer Tools invite you to embark on a journey of discovery and mastery, shaping the future of the web one line of code at a time.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Save my name, email, and website in this browser for the next time I comment.

  • Crowdfunding
  • Cryptocurrency
  • Digital Banking
  • Digital Payments
  • Investments
  • Console Gaming
  • Mobile Gaming
  • VR/AR Gaming
  • Gadget Usage
  • Gaming Tips
  • Online Safety
  • Software Tutorials
  • Tech Setup & Troubleshooting
  • Buyer’s Guides
  • Comparative Analysis
  • Gadget Reviews
  • Service Reviews
  • Software Reviews
  • Mobile Devices
  • PCs & Laptops
  • Smart Home Gadgets
  • Content Creation Tools
  • Digital Photography
  • Video & Music Streaming
  • Online Security
  • Online Services
  • Web Hosting
  • WiFi & Ethernet
  • Browsers & Extensions
  • Communication Platforms
  • Operating Systems
  • Productivity Tools
  • AI & Machine Learning
  • Cybersecurity
  • Emerging Tech
  • IoT & Smart Devices
  • Virtual & Augmented Reality
  • Latest News
  • AI Developments
  • Fintech Updates
  • Gaming News
  • New Product Launches

Close Icon

  • Hyperbaric Oxygen Therapy Revolutionizing Treatment for Various Conditions
  • 12 Best Free AI Image Sharpeners in 2024 WebPCMobile

Related Post

Hyperbaric oxygen therapy: revolutionizing treatment for various conditions, apple wallet availability in the pocketguard app: sync your apple card, apple cash, and savings from apple card accounts, unleashing young geniuses: how lingokids makes learning a blast, designing for flexibility: materials and manufacturing techniques in flexible hybrid electronics, robots acquires spyontech, clear hearings: navigating ear health with the scopearound otoscope, related posts.

How To Inspect On IPhone Safari

How To Inspect On IPhone Safari

How To Install Safari On Apple TV 4

How To Install Safari On Apple TV 4

How To Open Developer Tools In Safari

How To Open Developer Tools In Safari

How To Test Website On Safari On Windows

How To Test Website On Safari On Windows

How To Enable Inspect In Safari

How To Enable Inspect In Safari

How To Download Video On Safari

How To Download Video On Safari

How To Open Developer Tools On Safari

How To Open Developer Tools On Safari

How To Get Safari Back To Normal

How To Get Safari Back To Normal

Recent stories.

Hyperbaric Oxygen Therapy: Revolutionizing Treatment for Various Conditions

12 Best Free AI Image Sharpeners in 2024 (Web/PC/Mobile)

Sanjuksha Nirgude Soaring High with Robotics

Sanjuksha Nirgude Soaring High with Robotics

OpenStack Backup and Recovery Software

OpenStack Backup and Recovery Software

Apple Wallet Availability in the PocketGuard App: Sync your Apple Card, Apple Cash, and Savings from Apple Card Accounts

5 Ways to Improve IT Automation

What is Building Information Modelling?

What is Building Information Modelling?

How to Use Email Blasts Marketing To Take Control of Your Market

How to Use Email Blasts Marketing To Take Control of Your Market

Robots.net

  • Privacy Overview
  • Strictly Necessary Cookies

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.

  • Skip to main content
  • Skip to search
  • Skip to select language
  • Sign up for free
  • Português (do Brasil)

What are browser developer tools?

Every modern web browser includes a powerful suite of developer tools. These tools do a range of things, from inspecting currently-loaded HTML, CSS and JavaScript to showing which assets the page has requested and how long they took to load. This article explains how to use the basic functions of your browser's devtools.

Note: Before you run through the examples below, open the Beginner's example site that we built during the Getting started with the Web article series. You should have this open as you follow the steps below.

How to open the devtools in your browser

The devtools live inside your browser in a subwindow that looks roughly like this, depending on what browser you are using:

Screenshot of a browser with developer tools open. The web page is displayed in the top half of the browser, the developer tools occupy the bottom half. There are three panels open in the developer tools: HTML, with the body element selected, a CSS panel showing styles blocks targeting the highlighted body, and a computed styles panel showing all the author styles; the browser styles checkbox is not checked.

How do you pull it up? Three ways:

  • Windows: Ctrl + Shift + I or F12
  • macOS: ⌘ + ⌥ + I

Firefox hamburger menu icon that has more options to customize and control Firefox.

  • Chrome: More tools ➤ Developer tools
  • Safari: Develop ➤ Show Web Inspector. If you can't see the Develop menu, go to Safari ➤ Preferences ➤ Advanced , and check the Show Develop menu in menu bar checkbox.
  • Opera : Developer ➤ Developer tools
  • Context menu: Press-and-hold/right-click an item on a webpage (Ctrl-click on the Mac), and choose Inspect Element from the context menu that appears. ( An added bonus: this method straight-away highlights the code of the element you right-clicked.)

The firefox logo as a DOM element in an example website with a context menu showing. A context menu appears when any item on the web page is right-clicked. The last menu items is 'Inspect element'.

The Inspector: DOM explorer and CSS editor

The developer tools usually open by default to the inspector, which looks something like the following screenshot. This tool shows what the HTML on your page looks like at runtime, as well as what CSS is applied to each element on the page. It also allows you to instantly modify the HTML and CSS and see the results of your changes reflected live in the browser viewport.

A test website is opened in a tab in the browser. The browser developer tools sub-window is open. The developer tools has several tabs. Inspector is one of those tabs. Inspector tab displays the HTML code of the website. An image tag is selected from the HTML code. This results in highlighting of the image corresponding to the selected tag in the website.

If you don't see the inspector,

  • Tap/click the Inspector tab.
  • In Chrome, Microsoft Edge, or Opera, tap/click Elements.
  • In Safari, the controls are not so clearly presented, but you should see the HTML if you haven't selected something else to appear in the window. Press the Style button to see the CSS.

Exploring the DOM inspector

For a start, right-click (Ctrl-click) an HTML element in the DOM inspector and look at the context menu. The available menu options vary among browsers, but the important ones are mostly the same:

The browser developer tools sub-window is open. The inspector tab is selected. A link element is right-clicked from the HTML code available in the inspector tab. A context menu appears. The available menu options vary among browsers, but the important ones are mostly the same.

  • Delete Node (sometimes Delete Element ). Deletes the current element.
  • Edit as HTML (sometimes Add attribute / Edit text ). Lets you change the HTML and see the results on the fly. Very useful for debugging and testing.
  • :hover/:active/:focus . Forces element states to be toggled on, so you can see what their styling would look like.
  • Copy/Copy as HTML . Copy the currently selected HTML.
  • Some browsers also have Copy CSS Path and Copy XPath available, to allow you to copy the CSS selector or XPath expression that would select the current HTML element.

Try editing some of your DOM now. Double-click an element, or right-click it and choose Edit as HTML from the context menu. You can make any changes you'd like, but you cannot save your changes.

Exploring the CSS editor

By default, the CSS editor displays the CSS rules applied to the currently selected element:

Snippet of the CSS panel and the layout panel that can be seen adjacent to the HTML editor in the browser developer tools. By default, the CSS editor displays the CSS rules applied to the currently selected element in the HTML editor. The layout panel shows the box model properties of the selected element.

These features are especially handy:

  • The rules applied to the current element are shown in order of most-to-least-specific.
  • Click the checkboxes next to each declaration to see what would happen if you removed the declaration.
  • Click the little arrow next to each shorthand property to show the property's longhand equivalents.
  • Click a property name or value to bring up a text box, where you can key in a new value to get a live preview of a style change.
  • Next to each rule is the file name and line number the rule is defined in. Clicking that rule causes the dev tools to jump to show it in its own view, where it can generally be edited and saved.
  • You can also click the closing curly brace of any rule to bring up a text box on a new line, where you can write a completely new declaration for your page.

You'll notice a number of clickable tabs at the top of the CSS Viewer:

  • Computed : This shows the computed styles for the currently selected element (the final, normalized values that the browser applies).
  • Box Model : represents visually the current element's box model, so you can see at a glance what padding, border and margin is applied to it, and how big its content is.
  • Grid : If the page you are inspecting uses CSS grid, this section allows you to view the grid details.
  • Fonts : In Firefox, the Fonts tab shows the fonts applied to the current element.

Find out more

Find out more about the Inspector in different browsers:

  • Firefox Page inspector
  • Chrome DOM inspector (Opera's inspector works the same as this)
  • Safari DOM inspector and style explorer

The JavaScript debugger

The JavaScript debugger allows you to watch the value of variables and set breakpoints, places in your code that you want to pause execution and identify the problems that prevent your code from executing properly.

A test website that is served locally in port 8080. The developer tools sub-window is open. The JavaScript debugger tab is selected. It allows you to watch the value of variables and set breakpoints. A file with name 'example.js' is selected from the sources pane. A breakpoint is set at line number 18 of the file.

To get to the debugger:

Firefox menu icon that has more options to customize and control Firefox.

Chrome : Open the Developer tools and then select the Sources tab. (Opera works the same way.)

Safari : Open the Developer Tools and then select the Debugger tab.

Exploring the debugger

There are three panes in the JavaScript Debugger on Firefox.

The first pane on the left contains the list of files associated with the page you are debugging. Select the file you want to work with from this list. Click on a file to select it and view its contents in the center pane of the Debugger.

Snippet of the sources pane of the debugger tab in the browser developer tools. The files related to the current page that you are debugging are visible under the folder whose name is same as the url of the site that is open in the current browser tab.

Source code

Set breakpoints where you want to pause execution. In the following image, the highlight on the number 18 shows that the line has a breakpoint set.

Snippet of developer tools debugger panel with the breakpoint at line 18 highlighted.

Watch expressions and breakpoints

The right-hand pane shows a list of the watch expressions you have added and breakpoints you have set.

In the image, the first section, Watch expressions , shows that the listItems variable has been added. You can expand the list to view the values in the array.

The next section, Breakpoints , lists the breakpoints set on the page. In example.js, a breakpoint has been set on the statement listItems.push(inputNewItem.value);

The final two sections only appear when the code is running.

The Call stack section shows you what code was executed to get to the current line. You can see that the code is in the function that handles a mouse click, and that the code is currently paused on the breakpoint.

The final section, Scopes , shows what values are visible from various points within your code. For example, in the image below, you can see the objects available to the code in the addItemClick function.

Snippet of the sources pane of the debugger tab of the browser developer tools. In the call stack it shows the function that is called at Line 18, highlighting that a breakpoint is set at this line and showing the scope.

Find out more about the JavaScript debugger in different browsers:

  • Firefox JavaScript Debugger )
  • Microsoft Edge Debugger
  • Chrome Debugger
  • Safari Debugger

The JavaScript console

The JavaScript console is an incredibly useful tool for debugging JavaScript that isn't working as expected. It allows you to run lines of JavaScript against the page currently loaded in the browser, and reports the errors encountered as the browser tries to execute your code. To access the console in any browser:

If the developer tools are already open, click or press the Console tab.

Firefox menu

This will give you a window like the following:

The Console tab of the browser developer tools. Two JavaScript functions have been executed in the console. The user entered functions, and the console displayed the return values.

To see what happens, try entering the following snippets of code into the console one by one (and then pressing Enter):

Now try entering the following incorrect versions of the code and see what you get.

You'll start to see the kind of errors that the browser returns. Often these errors are fairly cryptic, but it should be pretty simple to figure these problems out!

Find out more about the JavaScript console in different browsers:

  • Firefox Web Console
  • Chrome JavaScript Console (Opera's inspector works the same as this)
  • Safari Console
  • Debugging HTML
  • Debugging CSS

Safari Dev Tools: The Complete 2023 Guide

Introduction to safari developer tools.

Safari is Apple's proprietary web browser that comes pre-installed on all Mac and iOS devices. Its integrated developer tools provide everything web developers need to build, debug and optimize websites for Apple's ecosystem.

In this comprehensive tutorial, we'll cover key capabilities of Safari's dev tools including:

  • The Web Inspector for inspecting page structure and CSS
  • The Debugger for stepping through JavaScript code
  • The Resources panel for auditing page assets
  • The Audits panel for testing web standards compliance
  • Device Mode for simulating mobile screens
  • Advanced debugging features like conditional breakpoints
  • Network throttling to simulate real-world conditions
  • Experimental features for early access

By the end, you'll have master expertise using Safari dev tools to squash bugs faster, improve site performance, and deliver exceptional web experiences across Apple devices. You'll also discover resources like DevHunt to continue exploring the latest Safari developer tools.

A Brief History of Safari

Safari originated within Apple in 2003, based on the open source KHTML rendering engine. It was first released for Mac OS X Panther and quickly became Apple's default browser.

In 2007, Apple launched the first Windows version of Safari to expand its userbase. That same year, Safari made its mobile debut on the first iPhone.

Over the years, Safari has gone through many major version updates adding new features and support for emerging web standards. It remains the pre-installed browser on all Apple operating systems and devices including Macs, iPhones and iPads.

Why Learn Safari Developer Tools?

Here are some key reasons web developers should learn Safari dev tools:

  • Pre-installed on all Mac and iOS devices, used by millions globally
  • Allows direct debugging on iOS devices
  • Can emulate mobile devices in desktop browser
  • Essential for targeting Apple's ecosystem
  • Identify optimizations for Safari to improve site experience
  • Learn how your sites perform on Safari and make improvements
  • Fix rendering issues specific to WebKit browser engine
  • Utilize experimental features to build cutting-edge websites
  • Discover new Safari dev tools on platforms like DevHunt

With Safari holding significant browser market share, especially in the mobile space, having expertise in its developer tools is vital for crafting high-quality cross-browser experiences.

Core Safari Developer Tools

Now let's dive into the core developer tools available within Safari on both desktop and mobile.

The Web Inspector

The Web Inspector is the main hub for visually inspecting and modifying a web page. Key functions include:

  • View and edit the live DOM tree
  • Inspect and modify CSS styles
  • Audit accessibility information
  • Analyze network requests and performance
  • Identify layout issues or style problems
  • Live edit code changes right in the browser

For front-end developers, the Inspector is indispensable for debugging HTML, CSS and accessibility issues. You can instantly see how changes to markup and styles affect rendering.

The Debugger

Safari's JavaScript Debugger allows pausing code execution to step through scripts line-by-line. You can:

  • Set breakpoints to isolate issues
  • Inspect stack traces and variable scopes
  • Profile memory usage and CPU utilization
  • Emulate device throttling conditions
  • Blackbox third-party scripts

The Debugger equips you to tackle even the most complex JavaScript bugs. From tracking down logic errors to profiling performance, it's an essential tool for front-end logic and optimization.

The Resources Panel

This panel displays all resources loaded by the page like scripts, stylesheets, fonts, images and media. For each resource you can:

  • View request URLs, status codes and timings
  • Filter by type, folder location or domain
  • Check dependencies and redundancy
  • Audit performance and bottlenecks
  • Download resources to your machine

Knowing exactly what resources a page loads is invaluable for optimizing performance. The Resources panel helps you eliminate unnecessary requests and prioritize critical assets.

Storage Inspector

The Storage Inspector lets you view and edit browser storage like cookies, LocalStorage, SessionStorage and IndexedDB. You can:

  • Add, modify or delete stored keys and values
  • Export storage data as JSON
  • Emulate different browser states for testing
  • Clear storage entirely to test initial experience

Being able to inspect persistence mechanisms is vital for debugging issues related to state management in modern web apps.

The Audits Panel

Safari's Audits panel runs diagnostics on pages to surface optimization opportunities and standards compliance issues. Audits include:

  • Performance analysis and scoring
  • Accessibility checks following WCAG guidelines
  • Best practices for progressive web apps
  • SEO enhancements
  • Modern web platform usage

Running audits before launching any website can help you catch critical problems early and compare against industry benchmarks.

Advanced Safari Developer Tools

Beyond the basics, Safari offers powerful advanced tools for seasoned developers.

Device Mode

Device Mode accurately emulates mobile screens and conditions right in desktop Safari:

  • Simulate precise device dimensions and resolution
  • Throttle CPU and network to mimic real devices
  • Essential for building mobile-friendly, responsive sites
  • Test touch events and gestures during development

With Device Mode, you can build fully optimized mobile experiences without constantly switching devices.

Advanced Debugging

Safari provides next-level JavaScript debugging capabilities:

  • Set conditional breakpoints using expressions
  • Group breakpoints for easy management
  • Step through async code with async stack traces
  • Profile memory heap allocations over time
  • Blackbox scripts to hide library code
  • Break on caught or uncaught exceptions

These advanced features help you tackle difficult bugs in even the most complex single-page apps and frameworks like Vue.js.

Network Throttling

Network Throttling allows simulating slow network connections, like 3G and LTE. You can:

  • Rate limit bandwidth and latency
  • Identify assets blocking page load
  • Debug loading behavior in emerging markets
  • Optimize performance for offline/low-bandwidth
  • Throttle cache usage and response compression

Testing how your site performs under real-world network conditions is crucial to providing good user experiences for all.

Experimental Features

Safari lets developers try out experimental tools before they are formally released:

  • Get early access to new capabilities
  • Provide feedback to help shape future features
  • Use at your own risk as they are still in development
  • Currently includes CSS Flexbox debugging tools

Tapping into experimental features allows you to build cutting-edge experiences and directly influence the browser platform's evolution.

Debugging JavaScript Issues

Now let's explore strategies for debugging JavaScript using Safari's advanced capabilities.

Breakpoint Usage

Effective breakpoint usage is key for isolating issues:

  • Set breakpoints directly within the source code
  • Organize breakpoints into groups by context
  • Use conditional breakpoints to pause on specific criteria
  • Disable breakpoints without deleting to toggle behavior
  • Manage breakpoints efficiently even in complex codebases

Mastering breakpoints gives you precise control over pausing execution to inspect logic flow and data.

Scope Inspection

Understanding scope is vital for tracking down variable issues:

  • Inspect variable values in different call frames
  • Detect scope pollution across closures and modules
  • Ensure code executes in the intended lexical scope
  • Fix bugs caused by accessing stale variable references
  • Avoid global namespace pollution

With Safari's scoping tools, you can confidently debug even complex nested closures and callback contexts.

Async Debugging

Safari provides multiple approaches for debugging asynchronous code:

  • Step through promise resolutions and rejections
  • Inspect async operation call stacks and task queues
  • Profile async code performance with CPU profiler
  • Set breakpoints within async callbacks and timers
  • Visually trace async code flows

Smooth async debugging helps you tackle race conditions, timing issues, and callback hell.

Error Handling

The key to debugging runtime errors is Safari's break on exception feature:

  • Break on any caught or uncaught exceptions
  • Inspect error call stacks to trace where issues originate
  • Log values with console.log() to debug logic flow
  • Validate edge cases and fix crashes
  • Handle errors gracefully to improve user experience

With robust error handling, you can isolate bugs quicker and build more resilient apps.

Optimizing Page Speed

Next let's explore some common techniques for optimizing page speed using Safari developer tools.

Image Optimization

Safari provides multiple ways to optimize images:

  • Audit image sizes and formats using the Resources panel
  • Compress and resize images as needed
  • Lazy load offscreen images to improve TTI
  • Serve next-gen formats like WebP to Safari users
  • Remove unnecessary decorative images

With Safari's insight into image resources, you can significantly cut page weight and load times.

Script Loading

Optimizing script loading is key for performance:

  • Minimize parser-blocking JavaScript
  • Load non-critical scripts asynchronously
  • Dynamically create and load scripts
  • Code split bundles into logical chunks
  • Tree shake and minify code to reduce payload

Safari shows you exactly how scripts impact loading behavior so you can optimize delivery.

Caching Assets

Effective caching can boost repeat visit performance:

  • Set optimal cache lifetimes for static assets
  • Cache assets locally using service workers
  • Version assets linked to app release cycles
  • Avoid cache-busting query strings
  • Maximize cache reuse for returning users

The Resources panel helps you dial in caching for faster loads without staleness.

Layout Thrashing

Diagnosing layout thrashing is key for smooth UX:

  • Identify forced synchronous layouts
  • Defer non-critical DOM updates with requestAnimationFrame()
  • Avoid reading styles after writes during rendering
  • Batch DOM reads/writes together
  • Profile with Debugger to pinpoint problems

With Safari's performance tools, you can isolate and fix sources of jank and lag.

Wrap Up and Key Takeaways

Safari developer tools provide everything needed to build high-quality websites targeting Apple's ecosystem.

Key highlights include:

  • Debugging directly on iOS devices with Web Inspector
  • Stepping through JavaScript with advanced Debugger features
  • Auditing pages for standards compliance
  • Simulating mobile devices and networks during development
  • Optimizing performance using Network Throttling
  • Trying out experimental capabilities early
  • Discovering new Safari dev tools on platforms like DevHunt

Learning Safari developer tools allows you to find and fix cross-browser issues faster. You can optimize sites specifically for Safari and deliver stellar experiences to millions of Apple users worldwide.

With a comprehensive understanding of Safari's robust toolset, you can confidently build, debug and enhance modern progressive web apps. Safari developer tools help web developers succeed across platforms.

safari javascript dev tools

Related posts

  • Safari Developer Tools: The Complete Guide for Web Developers
  • Discover the Top Web Developer Tools for 2023
  • Unlock Safari's Powerful Developer Tools
  • Dev Tools iOS Developers Need in 2023

This page requires JavaScript.

Please turn on JavaScript in your browser and refresh the page to view its content.

WebKit Features in Safari 18.0

Sep 16, 2024

by Jen Simmons

New in Safari 18

Web apps for mac, spatial web, managed media source, web inspector, safari extensions, deprecations, bug fixes and more, updating to safari 18.0.

Safari 18.0 is here. Along with iOS 18, iPadOS 18, macOS Sequoia and visionOS 2, today is the day another 53 web platform features, as well as 25 deprecations and 209 resolved issues land in WebKit, the rendering engine driving Safari.

Distraction Control

Distraction Control lets you hide distracting items as you browse the web, such as sign-in banners, cookie preference popups, newsletter signup overlays, and more, in Safari for iOS 18, iPadOS 18 and macOS Sequoia.

safari javascript dev tools

We always recommend using semantic HTML when creating a website, including <video> , <main> , <article> and other elements that describe content. Doing so helps ensure both Safari Reader and Safari Viewer work best for the users of your website.

Safari windows on a Mac, with a video playing, big, in one window. The website is faintly visible behind the large video.

iPhone Mirroring and remote inspection

With iPhone Mirroring on macOS Sequoia, you can use your iPhone from your Mac. Combine it with remote inspection from Safari, and now it’s easier than ever to test and debug websites on iOS using Web Inspector .

Get set up for remote inspection by first ensuring you have Safari’s developer tools enabled on your Mac (if you can see the Develop menu in Safari, you’ve already done this step). Next, enable Web Inspector on your iPhone at Settings > Apps > Safari > Advanced > Web Inspector. Then, you’ll need to connect the device to your Mac using a cable to grant permission. Once plugged in, your device will appear in the Develop menu in Safari. Finally, to enable wireless debugging, go to Safari on macOS > Develop > [your device] > Connect via Network.

Now you can use Web Inspector to wirelessly debug websites running on iPhone anytime. And with iPhone Mirroring, you don’t even have to pull out your phone. Everything is on your Mac’s screen.

Learn more about remote inspection by reading Inspecting iOS and iPadOS , or by watching Rediscover Safari developer features from WWDC. Learn more about iPhone Mirroring 1 on apple.com .

Last year , we added support for web apps in macOS Sonoma. You can add any website to your dock — whether or not it was built with a Manifest file, Service Worker, or other technology to customize the web app experience. Go to the site in Safari, then File > Add to Dock… where you can customize the icon, change the name, and even adjust the URL. Then, just click on the web app icon in your Dock, and the website will open as a stand-alone app.

This year brings two improvements to web apps on Mac.

Opening links

macOS Sequoia adds support for opening links directly in web apps. Now, when a user clicks a link, if it matches the scope of a web app, that link will open in the web app instead of their default web browser. For example, imagine you have added MDN Web Docs to your Dock. Then a colleague sends you a link to an MDN page in Messages, Mail, Slack, Discord, IRC, or any non-browser application on your Mac. Now when you click on that link, it will open in the MDN Web Docs web app instead of your default browser.

Clicking a link within a browser will maintain the current behavior. This feature only affects links opened elsewhere. (When a user is in Safari, clicking on a link that matches the scope of a web app that is added to Dock, they will see an “Open in web app” banner, unless they have previously dismissed the banner.)

By default, this behavior applies when the link matches the host of the web page used to create the web app. As a developer, you can refine this experience by defining the range of URLs that should open in the web app with the scope member in the web app manifest .

Extension support

Now users can personalize web apps on Mac with Safari Web Extensions and Content Blockers. Navigate to the web app’s Settings menu to access all the installed Content Blockers and Web Extensions. Any enabled in Safari will be on by default in the web app. Each web app is uniquely customizable, just like Safari profiles.

View Transitions

WebKit added support for the View Transitions API in Safari 18. It provides an optimized browser API to animate elements from one state to another. Safari supports the CSS View Transitions Module Level 1 specification that adds new CSS properties and pseudo-elements for defining transition animations, along with a new browser API to start transition animations and react to different transition states. It works by capturing the current (old) state of the page and applying an animated transition to the new state. By default, the browser applies a cross-fade between the states.

Call the document.startViewTransition() method to initiate the capture. You can pass a callback function as the first argument to make DOM state changes between the old and new captures. The method returns a ViewTransition object which contains promises that can be used to track when the view transition starts or ends.

Once the states are captured, a pseudo-element tree is built which can be targeted with CSS, allowing you to modify the CSS animations used for the transitions. The animations out of the old page state and into the new page state can be modified via the ::view-transition-new(*) and ::view-transition-old(*) selectors. You can also ask the browser to independently track state changes for a specific element by naming it with the CSS view-transition-name property. You can then use the pseudo-elements to customize animations for it.

The :active-view-transition pseudo-class becomes active on the root element when a view transition is running.

The example below demonstrates state management with tabbed navigation. Each tab view has a custom transition animation out and a subtly different animation in, while the tabs themselves rely on the default page transition.

Style Queries

WebKit for Safari 18.0 adds support for Style Queries when testing CSS Custom Properties. Similar to how developers can use Sass mixins, Style Queries can be used to define a set of reusable styles that get applied as a group.

Here, if the --background custom property is set to black, then certain styles will be applied — in this case to make the headline and paragraph text color white.

Don’t forget to pay attention the HTML structure. By default, Style Queries reference the styles on the direct parent element. You can create a different reference through the use of Container Query names.

currentcolor and system color keywords in Relative Color Syntax

Support for Relative Color Syntax shipped in Safari 16.4 . It lets you define colors in a more dynamic fashion, creating a new color from an existing color. The value lch(from var(--color) calc(L / 2) C H) for instance uses the lch color space to take the variable --color and calculate a new color that’s half its lightness, calc(L / 2) .

Now in Safari 18.0, the first browser to ship support, you can reference the currentcolor or a system color keyword as you define the new color. For example, this code will set the background color to be the same color as the text color, only 4 times lighter, as calculated in the oklch color space.

Being able to reference system color keywords opens up another world of options. System colors are like variables that represent the default colors established by the OS, browser, or user — defaults that change depending on whether the system is set to light mode, dark mode, high contrast mode, etc. For example, canvas represents the current default background color of the HTML page, while fieldtext matches the color of text inside form fields. Find the full list of system colors in CSS Color level 4 .

Relative Color Syntax lets you define dynamic connections between colors in your CSS, lessening the need to control color through variables in a tightly-regimented design system. Learn more about Relative Color Syntax by watching this portion of What’s new in CSS from WWDC23.

Translucent accent colors

Partially transparent colors in accent-color are now blended on top of the Canvas system color to match the latest updates to the web standard. This means that any of the many ways to define colors using an alpha channel will now work as expected when used to define an accent color for a form control.

Animating display

WebKit for Safari 18.0 adds support for transition animation of the display property.

Many developers are excited to use @starting-style along with transition-behavior and display: none interpolation. WebKit for Safari 17.4 added general support for transition-behavior , including transition-behavior: allow-discrete . WebKit for Safari 17.5 added support for @starting-style , letting you define starting values for transitioning an element as it’s created (or re-created). Now in WebKit for Safari 18.0, you can use these features together to transition the display property.

Backdrop Filter

Originally shipped in Safari 9.0, backdrop filter provides a way to apply graphics effects to the content behind a particular element. You can apply backdrop-filter to a headline, for example, and everything behind the headline will be blurred, or have decreased saturation, or increased contrast. Any of the filter functions from SVG can be used — blur() , brightness() , contrast() , drop-shadow() , grayscale() , hue-rotate() , invert() , opacity() , saturate() , and sepia() .

For many years, backdrop filter only worked in Safari. It was available when you prefixed the property with -webkit-backdrop-filter . Now, starting in Safari 18.0, you don’t need the prefix. We also improved our implementation, fixing bugs and boosting interoperability.

This demo shows eight different filters and what you might do with each one alone. You can, of course, combine filters to create even more interesting results. With backdrop filter supported in Safari since 2015, Edge since 2018, Chrome since 2019, Samsung Internet since 2020, and Firefox since 2022, this is a great time to consider the kind of graphic design possibilities it enables.

Content visibility

WebKit for Safari 18.0 adds support for content-visibility . This property controls whether or not an element renders its contents in a fashion that’s useful for making performance optimizations. It lets you communicate to the browser that certain portions of the page will likely be initially offscreen, and suggest they be omitted from layout and rendering. This can make the page load faster.

WebKit for Safari 18.0 adds parsing support for the custom value for the prefers-contrast media query. (It does not return “true” on Apple platforms, since there is no forced-colors mode in iOS, iPadOS, macOS or visionOS.)

Safari 18.0 for visionOS 2 adds support for immersive-vr sessions with WebXR . Now you can create fully immersive experiences for people using Apple Vision Pro and deliver them through the web. WebXR scenes are displayed using hardware-accelerated graphics driven by WebGL .

A beautiful garden rendered in created graphics. There's a tree with bright red leaves. A blue sky full of puffy white clouds. Bright green grass, with a path leading by plants and garden sculpture. It's a world created in WebXR.

Safari for visionOS 2 supports the new WebXR transient-pointer input mode. It lets you make the most of natural input on visionOS, and allow your users to interact with a look and a pinch.

We are in a rendered 3d environment, in a garden. We look at a chess board, with a real human hand lifting a rendered chess piece to make the next move in the game. A floating panel has two buttons reading "Leave garden" and "Reset game".

If you want to animate a 3D model of the user’s hands, Safari for visionOS 2 also includes support for WebXR hand tracking . To ensure privacy, permission to allow hand tracking will be requested from users at the start of their WebXR session.

Learn all about WebXR on visionOS 2 by watching Build immersive web experiences with WebXR from WWDC. Learn more about transient-pointer input mode by reading Introducing natural input for WebXR in Apple Vision Pro . And learn all about how to use Safari’s developer tools on Mac to inspect and debug in Apple Vision Pro by reading Try out your website in the spatial web .

Spatial photos and panoramas

One of the amazing experiences you can have on Apple Vision Pro is looking at spatial photos and panoramas. The web is a great place to share these photos with others.

A family blows out candles on a birthday cake in a photo — that's floating in a frame in midair, in a living room. This is a still from the WWDC23 Keynote that introduced Apple Vision Pro. It's an example of how spatial photos work.

When you open the Photos app in visionOS, you see your library of photos. When you tap an image, it appears alone in a floating frame in front of you. Spatial photos appear at just the right height and viewing angle to make it feel like you’ve gone back to a moment in time. A second tap of the UI breaks a spatial photo out of its frame, becoming even more immersive. Similarly, a panorama floats in a frame on first tap. Then on second tap of the UI, it expands to wrap all around you, creating a fully immersive experience.

Now in Safari 18.0 for visionOS 2, you can use the JavaScript Fullscreen API to create a similar experience on the web. You can embed the photo in a web page, and provide the ability to tap. The photo will pop into a floating frame as the Safari window disappears. Then when the user taps on the spatial photo or panorama UI that visionOS provides, the photo will further expand to create a more immersive experience. When they exit the image, the Safari window will return.

Let’s walk through how to support experiencing a spatial photo or panorama on the web using Fullscreen API. First, include the image on your web page using any of the techniques used for years. Here, we can embed a flattened panoramic photo into the web page using simple HTML.

Then using JavaScript, we’ll trigger .requestFullscreen() on tap. Perhaps like this.

You could, of course, create your own UI for the user to tap, rather than making the entire photo the tap target.

Spatial images work just the same, although it’s likely we want to provide fallbacks for browsers that do not support HEIC files . We can do so with the picture element.

Spatial images are stereoscopic, with both a left and right channel. In Safari, when the image is embedded in the web page, the browser will show the left channel. And there’s no need to worry about providing a fallback of any sort for Safari on macOS, iOS, or iPadOS — the stereoscopic HEIC file works great.

This technique will also cause images to go fullscreen in any browser that supports Fullscreen API. Learn more about adding panorama and spatial photos to your websites by watching Optimize for the spatial web from WWDC.

Shaping interaction regions on visionOS

As a web developer, you’re very familiar with how link styling works on the web. For decades you’ve been able to use CSS to style text-decoration , color and more for :link , :hover , :active , and :visited states. You’ve also been able to adjust the size of the invisible tap target through use of padding.

Apple Vision Pro adds a new dimension to how links work — tap targets are visible on visionOS. Anytime a user looks at an interactive element, it’s highlighted to let them know that it can be tapped. And you as a designer or developer can intentionally design how an interaction region looks. You may want to add padding, for instance, or even a rounded corner to the otherwise invisible box.

Now in Safari in visionOS 2 , when you use CSS clip-path to change the shape of tappable area of a link, the visible interaction region will change shape as well. Interactive UI elements built with SVG and cursor: pointer will also be highlighted with the proper shape. Learn more by watching Optimize for the spatial web from WWDC.

Video on visionOS

Safari for visionOS 2 adds support for docking fullscreen videos into the current Environment . Anytime a user is watching a video fullscreen, they can tap the mountain symbol to enter an immersive experience. Turning the Digital Crown adjusts the immersion.

Writing Suggestions

At last year’s WWDC, Apple unveiled inline predictive text on iOS, iPadOS, macOS and more. It helps users input text faster by predicting what they might be typing and finishing the word, phrase or even a whole sentence when the user taps the space bar. Now, WebKit for Safari 18.0 on iOS, iPadOS, visionOS, macOS Sequoia and macOS Sonoma brings inline predictive text to the web.

While inline predictive text makes for a fantastic, personalized user experience, there might be specific situations on the web where it’s better to not have predictions. WebKit for Safari 18.0 on iOS, iPadOS, visionOS, macOS Sequoia and macOS Sonoma gives web developers the opportunity to disable inline predictions through the writingsuggestions attribute. By default, writing suggestions is set to true. You can turn off the capability by including the writingsuggestions="false" attribute on any type of text input field.

WebKit for Safari on iOS 18 adds haptic feedback for <input type=checkbox switch> . This means, now when a user taps a switch control on iPhone, a single tap is felt — just like how toggling a switch feels in Settings app on iOS. Try this demo to see what it’s like.

Date and time inputs

WebKit for Safari 18.0 on macOS improves accessibility support for date and time input field types. Now <input type="date"> , <input type="datetime-local"> , and <input type="time"> elements work properly with VoiceOver.

Usually elements have the labels they need, but sometimes there is no text label for a particular button or UI. In this situation, ARIA can be used to provide an accessible label. The aria-label attribute provides names of labels while aria-roledescription provides the description for the role of an element.

On very rare occasions, you may need to override aria-label or aria-roledescription to provide different names or descriptions specifically for braille. The aria-braillelabel and aria-brailleroledescription attributes provide such an ability. They exist to solve very specific needs, including educational contexts where the site needs to render the specific braille table dot pattern. If you do use braille-related ARIA attributes, be sure to test them using a braille reader. If in doubt, relying on the accessible name from content or aria-label / aria-roledescription is almost always the better user experience . WebKit has supported these ARIA attributes for years.

Now, WebKit for Safari 18.0 adds support for the ariaBrailleLabel and ariaBrailleRoleDescription element reflection properties. These make it possible to get and set the aria-braillelabel and aria-brailleroledescription ARIA attributes on DOM elements directly via JavaScript APIs, rather than by using setAttribute and getAttribute .

WebKit for Safari 18.0 adds support for Unicode 15.1.0 characters in RegExp. Unicode 15.1 added 627 characters, bringing the total of characters to 149,813. Now, these new characters can be used in regular expressions.

WebKit for Safari 18.0 also adds support for the v flag with RegExp.prototype[Symbol.matchAll] . providing more powerful ways to match Unicode characters, as specified in the ECMAScript 2024 standard.

For example, you can now specify to only match on Latin characters, while avoiding matching on Cyrillic script characters.

Or split a string matching on Emojis.

WebKit for Safari 18.0 adds support for URL.parse() , a way to parse URLs which returns null rather than an exception when parsing fails.

WebKit for Safari 18.0 expands Declarative Shadow tree support by adding the shadowRootDelegatesFocus and shadowRootClonable IDL attributes to the <template> element. It also adds the shadowRootSerializable attribute and shadowRootSerializable IDL attribute to the <template> element, enabling those using Declarative Shadow roots to opt into making them serializable. Serializing can be done through the new getHTML() method that has been added at the same time.

WebKit for Safari 18.0 adds support for PopStateEvent ’s hasUAVisualTransition , indicating whether the user agent has a visual transition in place for the fragment navigation.

WebKit for Safari 18.0 adds support for subresource integrity in imported module scripts, which gives cryptographic assurances about the integrity of contents of externally-hosted module scripts.

WebKit for Safari 18.0 adds support for the bytes() method to the Request, Response , Blob , and PushMessageData objects. This replaces the need for web developers to call arrayBuffer() , which can be difficult to use, and wraps the result in a Uint8Array . Calling bytes() is now the recommended way going forward when you need to access the underlying bytes of the data these objects represent.

WebKit for Safari 18.0 adds support for feature detecting text fragments by exposing document.fragmentDirective . Note that the returned object (a FragmentDirective ) doesn’t provide any functionality, but it’s helpful if you need to know if Fragment Directives are supported by the browser.

WebKit for Safari 18.0 adds support for the willReadFrequently context attribute for the getContext() method. It indicates whether or not a lot of read-back operations are planned. It forces the use of a software accelerated 2D or offscreen canvas, instead of hardware accelerated. This can improve performance when calling getImageData() frequently.

WebKit for Safari 18.0 extends 2D canvas support for currentcolor . It can now be used inside color-mix() or Relative Color Syntax. Here currentcolor will default to the computed color property value on the canvas element.

WebKit for Safari 18.0 adds Workers support for both Managed Media Source (MMS) and Media Source Extensions ( MSE ). This can be especially helpful on complex websites that want to ensure continuous and smooth video playback even when other site activity (such as live commenting) causes a very busy main thread. You can see the performance difference in this demo .

WebKit for Safari 18.0 adds support for the WebRTC HEVC RFC 7789 RTP Payload Format. Previously, the WebRTC HEVC used generic packetization instead of RFC 7789 packetization. This payload format provides a new option for improving videoconferencing, video streaming, and delivering high-bitrate movies and TV shows.

WebKit for Safari 18.0 adds support for MediaStreamTrack processing in a dedicated worker. And it adds support for missing WebRTC stats.

WebKit for Safari 18.0 adds support for secure HTTPS for all images, video, and audio by upgrading passive subresource requests in mixed content settings. This means that if some files for a website are served using HTTPS and some are served using HTTP (known as “mixed content”), all images and media will now be auto-upgraded to HTTPS, in adherence with Mixed Content Level 2 .

WebKit for Safari 18.0 adds support for six new WebGL extensions:

  • EXT_texture_mirror_clamp_to_edge
  • WEBGL_render_shared_exponent
  • WEBGL_stencil_texturing
  • EXT_render_snorm
  • OES_sample_variables
  • OES_shader_multisample_interpolation

WebKit for Safari 18.0 adds support for fuzzy search code completion in the Web Inspector’s CSS source editor.

Two years ago at WWDC22, we announced support for passkeys — a groundbreaking industry-standard way to login to websites and app services. Passkeys provide people with an extremely easy user experience, while delivering a profound increase in security. To learn more, watch Meet Passkeys or read Supporting passkeys .

WebKit for Safari 18.0 adds support for three new features as we continue to improve passkeys. First, Safari 18.0 adds support for using mediation=conditional for web authentication credential creation. This allows websites to automatically upgrade existing password-based accounts to use passkeys. Learn more by watching Streamline sign-in with passkey upgrades and credential managers from WWDC.

Second, WebKit for Safari 18.0 adds support for using passkeys across related origins. This lets websites use the same passkey across a limited number of domains which share a credential backend.

And third, WebKit for Safari 18.0 adds support for the WebAuthn prf extension. It allows for retrieving a symmetric key from a passkey to use for the encryption of user data.

Safari 18.0 also adds support for Mobile Device Management of extension enabled state, private browsing state, and website access on managed devices. This means schools and businesses that manage iOS, iPadOS, or macOS devices can now include the configuration of Safari App Extensions, Content Blockers, and Web Extensions in their management.

WebKit for Safari 18.0 adds support for funds transfer via Apple Pay.

While it’s rare to deprecate older technology from the web, there are occasions when it makes sense. We’ve been busy removing -webkit prefixed properties that were never standardized, aging media formats that were never supported in other browsers, and more. This helps align browser engines, improve interoperability, and prevent compatibility problems by reducing the possibility that a website depends on something that’s not a web standard.

WebKit for Safari 18.0 removes support for OffscreenCanvasRenderingContext2D ’s commit() method.

WebKit for Safari 18.0 deprecates support for a number of rarely used -webkit prefixed CSS pseudo-classes and properties — and even one -khtml prefixed property.

  • -webkit-alt and alt properties
  • :-webkit-animating-full-screen-transition pseudo-class
  • :-webkit-full-screen-ancestor pseudo-class
  • :-webkit-full-screen-controls-hidden pseudo-class
  • :-webkit-full-page-media pseudo-class
  • :-webkit-full-screen-document pseudo-class
  • :-khtml-drag pseudo-class

WebKit for Safari 18.0 also deprecates support for the resize: auto rule. Support for the resize property remains, just as it’s been since Safari 4. The values Safari continues to support include : none , both , horizontal , vertical , block , inline , plus the global values. Early versions of CSS Basic User Interface Module Level 3 defined auto , but it was later written out of the web standard.

WebKit for Safari 18.0 also deprecates support for non-standardize WEBKIT_KEYFRAMES_RULE and WEBKIT_KEYFRAME_RULE API in CSSRule .

WebKit for Safari 18.0 removes support for the JPEG2000 image format. Safari was the only browser to ever provide support.

If you’ve been serving JPEG2000 files using best practices, then your site is using the picture element to offer multiple file format options to every browser. Safari 18.0 will simply no longer choose JPEG2000, and instead use a file compressed in JPEG XL, AVIF, WebP, HEIC, JPG/JPEG, PNG, or Gif — choosing the file that’s best for each user. Only one image will be downloaded when you use <picture> , and the browser does all the heavy lifting.

We have noticed that some Content Deliver Networks (CDN) use User Agent sniffing to provide one file to each UA, offering only JPEG2000 images to Safari — especially on iPhone and iPad. If you expect this might be happening with your site, we recommend testing in Safari 18.0 on both macOS Sequoia and iOS or iPadOS 18. If you see problems, contact your SaaS provider or change your image delivery settings to ensure your website provides fallback images using industry best practices.

If you notice a broken site, please file an issue at webcompat.com .

WebKit for Safari 18.0 removes [[VarNames]] from the global object to reflect changes in the web standard, a change that now allows this code to work:

WebKit for Safari 18.0 removes support for non-standard VTTRegion.prototype.track .

WebKit for Safari 18.0 removes the last bits of support for AppCache.

When AppCache first appeared in 2009, in Safari 4, it held a lot of promise as a tool for caching web pages for use offline. It was imagined as “HTML5 Application Cache” back when HTML itself was being further expanded to handle more use cases for web applications. A developer could create a simple cache manifest file with a list of files to be cached. Its simplicity looked elegant, but there was no mechanism for cache busting, and that made both developing a site and evolving the site over time quite frustrating. AppCache also had security challenges. So new web standards were created to replace it. Today, developers use Service Workers and Cache Storage instead.

WebKit deprecated AppCache with a warning to the Console in Safari 11.0. Then in 2021, we removed support for AppCache from Safari 15.0, with a few exceptions for third-party users of WKWebView . Now we are removing those exceptions. This change to WebKit will only affect the rare web content loaded in older third-party apps that have JavaScript code which relies on the existence of AppCache related interfaces.

WebKit for Safari 18.0 removes the SVGAnimateColorElement interface, as well as the non-standard getTransformToElement from SVGGraphicsElement .

WebKit for Safari 18.0 removes support for four non-standard Web APIs:

  • KeyboardEvent.altGraphKey
  • AES-CFB support from WebCrypto
  • KeyboardEvent.prototype.keyLocation
  • HashChangeEvent ’s non-standard initHashChangeEvent() method

Deprecated some legacy WebKit notification names including:

  • WebViewDidBeginEditingNotification
  • WebViewDidChangeNotification
  • WebViewDidEndEditingNotification
  • WebViewDidChangeTypingStyleNotification
  • WebViewDidChangeSelectionNotification

In addition to all the new features, WebKit for Safari 18.0 includes work to polish existing features.

Accessibility

  • Fixed role assignment for <header> inside <main> and sectioning elements.
  • Fixed range input not firing an input event when incremented or decremented via accessibility APIs.
  • Fixed setting aria-hidden on a slot not hiding the slot’s assigned nodes.
  • Fixed VoiceOver to read hidden associated labels.
  • Fixed comboboxes to expose their linked objects correctly.
  • Fixed VoiceOver support for aria-activedescendant on macOS.
  • Fixed time input accessibility by adding labels to subfields.
  • Fixed aria-hidden=true to be ignored on the <body> and <html> elements.
  • Fixed datetime values being exposed to assistive technologies in the wrong timezone.
  • Fixed wrong datetime value being exposed to assistive technologies for datetime-local inputs.
  • Fixed ignored CSS content property replacement text when it is an empty string.
  • Fixed the computed role for these elements: dd , details , dt , em , hgroup , option , s , and strong .
  • Fixed hidden elements targeted by aria-labelledby to expose their entire subtree text, not just their direct child text.
  • Fixed accessible name computation for elements with visibility: visible inside a container with visibility: hidden .
  • Fixed updating table accessibility text when its caption dynamically changes.
  • Fixed updating aria-describedby text after the targeted element changes its subtree.
  • Fixed the transition property to produce the shortest serialization.
  • Fixed the animation property to produce the shortest serialization.
  • Fixed arbitrary 8 digit limit on a line item’s total amount.

Authentication

  • Fixed navigator.credentials.create() rejects with “NotAllowedError: Operation Failed” after a conditional UI request is aborted.
  • Fixed setting the cancel flag once the cancel completes regardless of a subsequent request occurring.
  • Fixed drawImage(detachedOffscreenCanvas) to throw an exception.
  • Fixed OffscreenCanvas failing to render to the placeholder with nested workers.
  • Fixed losing the contents layer of the placeholder canvas of OffscreenCanvas when switching off the tab.
  • Fixed drawImage to not alter the input source or the destination rectangles.
  • Fixed toggling the visibility on a canvas parent undoing the effect of clearRect() .
  • Fixed the Canvas drawImage() API to throw an exception when the image is in broken state.
  • Fixed a detached OffscreenCanvas to not transfer an ImageBuffer.
  • Fixed treating the lack of an explicit “SameSite” attribute as “SameSite=Lax”.
  • Fixed setting white-space to a non-default value dynamically on a whitespace or a new line.
  • Fixed custom counter styles disclosure-open and disclosure-closed to point to the correct direction in right-to-left.
  • Fixed backface-visibility to create a stacking context and containing block.
  • Fixed getComputedStyle() to work with functional pseudo-elements like ::highlight() .
  • Fixed: Aliased :-webkit-full-screen pseudo-class to :fullscreen .
  • Fixed: Aliased :-webkit-any-link to :any-link and :matches() to :is() .
  • Fixed getComputedStyle() pseudo-element parsing to support the full range of CSS syntax.
  • Fixed @supports to correctly handle support for some -webkit prefixed pseudo-elements that were incorrectly treated as unsupported.
  • Fixed updating media-query sensitive meta tags after style changes.
  • Fixed changing color scheme to update gradients with system colors or light-dark() .
  • Fixed incorrect inline element size when using font-variant-caps: all-small-caps with font-synthesis .
  • Fixed :empty selector to work with animations.
  • Fixed preserving whitespace when serializing custom properties.
  • Fixed updating style correctly for non-inherited custom property mutations.
  • Fixed element removed by parent to end up losing the last remembered size.
  • Fixed an incorrect difference between implicit and explicit initial values for custom properties.
  • Fixed the contrast of Menu and MenuText system colors.
  • Fixed keeping the shorthand value for CSS gap as-is in serialized and computed values.
  • Fixed the style adjuster for @starting-style incorrectly invoking with a null element.
  • Fixed excluding -apple-pay-button from applying to any element that supports appearance: auto and is not a button.
  • Fixed missing color interpretation methods added to CSS color specifications.
  • Fixed hsl() and hsla() implementation to match the latest spec changes.
  • Fixed the implementation of rgb() and rgba() to match the latest spec.
  • Fixed the hwb() implementation to match the latest spec.
  • Fixed the remaining color types to be synced with the latest spec changes.
  • Fixed carrying analogous components forward when interpolating colors.
  • Fixed applying the fill layer pattern for mask-mode .
  • Fixed backdrop-filter: blur to render for elements not present when the page is loaded.
  • Fixed: Improved large Grid performance.
  • Fixed some CSS properties causing quotes to be reset.
  • Fixed an issue where input method editing would sporadically drop the composition range.
  • Fixed dictation UI no longer showing up when beginning dictation after focusing an empty text field. (FB14277296)
  • Fixed displayed datalist dropdown to sync its options elements after a DOM update.
  • Fixed input elements to use the [value] as the first fallback step base.
  • Fixed <select multiple> scrollbars to match the used color scheme.
  • Fixed updating the input value when selecting an <option> from a <datalist> element. (FB13688998)
  • Fixed the value attribute not getting displayed in an input element with type="email" and the multiple attribute.
  • Fixed the iOS animation for <input type=checkbox switch> .
  • Fixed form controls drawing with an active appearance when the window is inactive.
  • Fixed constructed FormData object to not include entries for the image button submitter by default.
  • Fixed the properties of History to throw a SecurityError when not in a fully active Document.
  • Fixed “about:blank” document.referrer initialization.
  • Fixed parsing a self-closing SVG script element. It now successfully executes.
  • Fixed RegExp.prototype.@@split to update the following legacy RegExp static properties: RegExp.input , RegExp.lastMatch , RegExp.lastParen , RegExp.leftContext , RegExp.rightContext , and RegExp.$1, ... RegExp.$9 .
  • Fixed String.prototype.replace to not take the fast path if the pattern is RegExp Object and the lastIndex is not numeric.
  • Fixed spec compliance for Async / Await, Generators, Async Functions, and Async Generators.
  • Fixed async functions and generators to properly handle promises with throwing “constructor” getter.
  • Fixed return in async generators to correctly await its value.
  • Fixed Symbol.species getters to not share a single JS Function.
  • Fixed throwing a RangeError if Set methods are called on an object with negative size property.
  • Fixed eval() function from another realm to not cause a direct eval call.
  • Fixed eval() call with ...spread syntaxt to be a direct call.
  • Fixed try/catch to not intercept errors originated in [[Construct]] of derived class.
  • direct eval() in a default value expression inside a rest parameter creates a variable in the environment of the function rather than the separate one of the parameters;
  • a ReferenceError is thrown when accessing a binding, which is defined inside rest parameter, in eval() , or a closure created in a default value expression of a preceding parameter, but only if there is a var binding by the same name;
  • a closure, created in the default value expression inside a rest parameter, is created in a different VariableEnvironment of the function than its counterparts in preceding parameters which causes the incorrect environment to be consulted when querying or modifying parameter names that are “shadowed” by var bindings.
  • Fixed TypedArray sorting methods to have a special-case for camparator returning false .
  • Fixed programming style for bitwise and in setExpectionPorts.
  • Fixed emitReturn() to load this value from arrow function lexical environment prior to the TDZ check.
  • Fixed NFKC normalization to work with Latin-1 characters.
  • Fixed parsing of private names with Unicode start characters.
  • Fixed instanceof to not get RHS prototype when LHS is primitive.
  • Fixed bracket update expression to resolve property key at most once.
  • Fixed bracket compound assignement to resolve the property key at most once.
  • Fixed Object.groupBy and Map.groupBy to work for non-objects.
  • Fixed Array.fromAsync to not call the Array constructor twice.
  • Fixed inconsistent output of Function.prototype.toString for accessor properties.
  • Fixed Set#symmetricDifference to call this.has in each iteration.
  • Fixed logical assignment expressions to throw a syntax error when the left side of the assignment is a function call.
  • Fixed throwing a syntax error for nested duplicate-named capturing groups in RegEx.
  • Fixed ArrayBuffer and SharedArrayBuffer constructor to check length before creating an instance.
  • Fixed Intl implementation to ensure canonicalizing “GMT” to “UTC” based on a spec update.
  • Fixed RegEx lookbehinds differing from v8.
  • Fixed fractionalDigits of Intl.DurationFormat to be treated as at most 9 digits if it is omitted.
  • Fixed optimized TypedArrays giving incorrect results.
  • Fixed Intl.DurationFormat for numeric and 2-digit .
  • Fixed navigator.cookieEnabled to return false when cookies are blocked.
  • Fixed MediaSession to determine the best size artwork to use when the sizes metadata attribute is provided. (FB9409169)
  • Fixed video sound coming from another window after changing tabs in the Tab Bar in visionOS.
  • Fixed playback for MSE videos on some sites.
  • Fixed allowing a video’s currentTime to be further than the gap’s start time.
  • Fixed broken audio playback for a WebM file with a Vorbis track.
  • Fixed sampleRate and numberOfChannels to be required and non-zero in a valid AudioEncoderConfig.
  • Fixed media elements appending the same media segment twice.
  • Fixed an issue where Safari audio may be emitted from the wrong window in visionOS.
  • Fixedrejecting valid NPT strings if ‘hours’ is defined using 1 digit.
  • Fixed picture-in-picture when hiding the <video> element while in Viewer.
  • Fixed the return button not working after the video is paused and played in picture-in-picture.
  • Fixed upgrading inactive or passive subresource requests and fetches in would-be mixed security contexts to match standards.
  • Fixed incorrect Sec-Fetch-Site value for navigation of a nested document.
  • Fixed loading WebArchives with a non-persistent datastore.
  • Fixed Timing-Allow-Origin to not apply to an HTTP 302 response.
  • Fixed print buttons with a print action implementation.
  • Fixed Open in Preview for a PDF with a space in its name.
  • Fixed “Open with Preview” context menu item to work with locked PDF documents.
  • Fixed Greek uppercase transforms failing for some characters.
  • Fixed resizing a <textarea> element with 1rem padding.
  • Fixed the color correctness of the color matrix filter.
  • Fixed backdrop-filter to apply to the border area of an element with a border-radius .
  • Fixed intrinsic inline size calculators to account for whitespace before an empty child with nonzero margins.
  • Fixed overlapping elements with flex box when height: 100% is applied on nested content.
  • Fixed incorrect grid item positioning with out-of-flow sibling.
  • Fixed break-word with a float discarding text.
  • Fixed min-content calculation for unstyled only-child inlines elements.
  • Fixed ellipsis rendering multiple times when position: relative and top are used.
  • Fixed a bug for inline elements inserted in reverse order after a block in a continuation.
  • Fixed the flash of a page background-colored bar in the footer when the window is resized.
  • Fixed garbled bold text caused by glyph lookup using the wrong font’s glyph IDs when multiple installed fonts have the same name. (FB13909556)
  • Fixed selecting Japanese text annotated with ruby in a vertical-rl writing mode table.
  • Fixed support for border, padding, and margin on mfrac and mspace elements in MathML.
  • Fixed the cursor not updating as content scrolls under it on some pages.
  • Fixed stripping the scroll-to-text fragment from the URL to prevent exposing the fragment to the page.
  • Fixed CORS bypass on private localhost domain using 0.0.0.0 host and mode “no-cors”.
  • Fixed blocking cross-origin redirect downloads in an iframe.
  • Fixed blocked cross-origin redirect downloads to attempt rendering the page instead.
  • Fixed the SVG parser to interpret “form feed” as white space.
  • Fixed error handling for invalid filter primitive references.
  • Fixed displaying an SVG element inside a <switch> element.
  • Fixed SVG title to have display: none as the default UA style rule.
  • Fixed the UA stylesheet for links in SVGs to apply cursor: pointer matching standards.
  • Fixed returning the initial value for the SVG gradient stop-color if it is not rendered in the page.
  • Fixed the SVG marker segment calculations if the marker path consists of sub-paths.
  • Fixed SVGLength to sync with the WebIDL specification.
  • Fixed disclosure counter styles to consider writing-mode .

Web Animations

  • Fixed percentage transform animations when width and height are animated.
  • Fixed updating an animation when changing the value of a transform property while that property is animated with an implicit keyframe.
  • Fixed display transition to none .
  • Fixed cssText setter to change the style attribute when the serialization differs. (FB5535475)
  • Fixed history.pushState() and history.replaceState() to ignore the title argument.
  • Fixed URL text fragment directives not fully stripped from JavaScript.
  • Fixed showPicker() method to trigger suggestions from a datalist .
  • Fixed lang attribute in no namespace to only apply to HTML and SVG elements.
  • Fixed unnecessarily unsetting the iframe fullscreen flag.
  • Fixed DOM Range to correctly account for CDATASection nodes.
  • Fixed getGamepads() to no longer trigger an insecure contexts warning.
  • Fixed inserting a <picture> element displaying the same image twice.
  • Fixed throwing exceptions in navigation methods if in a detached state.
  • Fixed a minor issue in URL’s host setter.
  • Fixed cloning of ShadowRoot nodes following a DOM Standard clarification.
  • Fixed GeolocationCoordinates to expose a toJSON() method.
  • Fixed IntersectionObserver notifications that sometimes fail to fire.
  • Fixed GeolocationPosition to expose a toJSON() method.
  • Fixed setting CustomEvent.target when dispatching an event.
  • Fixed navigator.language only returning the system language in iOS 17.4.
  • Fixed: Removed presentational hints from the width attribute for <hr> .
  • Fixed an issue when inserting writing suggestions into an editable display: grid container.
  • Fixed the warning message for window.styleMedia .
  • Fixed resolving www. sub-domain for Associated Domains for all web apps.

Web Assembly

  • Fixed initialization of portable reference typed globals.

Web Extensions

  • Fixed getting an empty key from storage. (FB11427769)
  • Fixed Service Workers not appearing in the Develop menu or remote Web Inspector menu. (130712941)
  • Fixed web extensions unable to start due to an issue parsing declarativeNetRequest rules. (FB14145801)
  • Fixed font sizes in the Audits tab.
  • Fixed expanded sections of Storage to not collapse.
  • Fixed Web Inspector to show nested workers.
  • Fixed CSS font property values marked !important not getting overridden when using the interactive editing controls.
  • Fixed an issue where the Web Inspector viewport might appear cut off.
  • Fixed runtimes to be aligned in the Audit tab.
  • Fixed remembering the message type selection in the Console tab.
  • Fixed autocomplete for the text-indent property suggesting prefixed properties instead of each-line or hanging .
  • Fixed background autocompletion suggestion to include repeating-conic-gradient .
  • Fixed the list of breakpoints in the Sources tab disappearing when Web Inspector is reloaded.
  • Fixed console clearing unexpectedly when Web Inspector reopens.
  • Fixed console code completion to be case-insensitive.
  • Fixed overflow: scroll elements to scroll as expected when highlighting an element from the DOM tree.
  • Fixed showing additional Safari tabs from an iOS device in the Develop menu.
  • Fixed Console and code editor completion not auto-scrolling the suggestion into view.
  • Fixed search in the DOM tree view unexpectedly chaning the text display.
  • Fixed clicking the “goto” arrow for computed CSS when “show independent Styles sidebar” is disabled.
  • Fixed inspectable tabs from Safari in the visionOS Simulator don’t appear in Developer menu on the host macOS.
  • Fixed Accessibility inspector for switch controls to report “State: on/off” instead of “Checked: true/false”.
  • Fixed Gamepad API in WKWebView.
  • Fixed repainting HTML elements when their width or height change in legacy WebView.
  • Fixed retrieving titles containing multibyte characters.
  • Fixed RTCEncodedVideoFrame and RTCEncodedAudioFrame to match the WebIDL specification.
  • Fixed VideoTrackGenerator writer to close when its generator track (and all its clones) are stopped.
  • Fixed WebRTC AV1 HW decoding on iPhone 15 Pro.
  • Fixed black stripes with screen sharing windows.
  • Fixed black stripes with getDisplayMedia captured windows when the window is resized.

Safari 18.0 is available on iOS 18 , iPadOS 18 , macOS Sequoia , macOS Sonoma, macOS Ventura, and in visionOS 2 .

If you are running macOS Sonoma or macOS Ventura, you can update Safari by itself, without updating macOS. Go to  > System Settings > General > Software Update and click “More info…” under Updates Available.

To get the latest version of Safari on iPhone, iPad or Apple Vision Pro, go to Settings > General > Software Update, and tap to update.

We love hearing from you. To share your thoughts on Safari 18.0, find us on Mastodon at @[email protected] and @[email protected] . Or send a reply on X to @webkit . You can also follow WebKit on LinkedIn . If you run into any issues, we welcome your feedback on Safari UI (learn more about filing Feedback ), or your WebKit bug report about web technologies or Web Inspector. If you notice a website that seems broken in Safari, but not in other browsers, please file a report at webcompat.com . Filing issues really does make a difference.

Download the latest Safari Technology Preview on macOS to stay at the forefront of the web platform and to use the latest Web Inspector features.

You can also find this information in the Safari 18.0 release notes .

1. iPhone Mirroring is available on Mac computers with Apple silicon and Intel-based Mac computers with a T2 Security Chip. Requires that your iPhone and Mac are signed in with the same Apple ID using two-factor authentication, your iPhone and Mac are near each other and have Bluetooth and Wi-Fi turned on, and your Mac is not using AirPlay or Sidecar. iPhone Mirroring is not available in all regions.

  • Web Browser
  • Google Chrome Browser
  • Mozilla Firefox Browser
  • Microsoft Edge Browser
  • Apple Safari Browser
  • Tor Browser
  • Opera Browser
  • DuckDuckGo Browser
  • Brave Browser

Shortcuts for Safari Developer Tools

Safari Developer Tools are a big help for people who make websites. They provide features to check, fix, and improve web pages. Shortcuts are one of the best tools. They help you quickly and easily move through web development, making things faster.

Types of Shortcuts:

Table of Content

Navigation Shortcuts

Console shortcuts, debugger shortcuts, miscellaneous shortcuts, features of shortcuts.

  • Inspect Element Shortcuts: Use quick keys to go fast through the DOM (Document Object Model) and check out how web parts are put together. Then, look closely at their structure for extra understanding of what’s going on in websites.
  • Console Shortcuts: Use shortcuts to run JavaScript commands quickly, letting developers fix problems and test stuff using the console.
  • Network Panel Shortcuts: Make checking network activities easier by using shortcuts to go through requests, answers and speed details.
  • Source Code Shortcuts: Make fixing computer program errors easier by using quick ways to move through coding, put breakpoints and check what works.

Benefits of Shortcuts

  • Time Efficiency: Shortcuts save time on boss tasks. They let builders do things fast and concentrate more important parts of building stuff.
  • Enhanced Productivity: Developers can do more in less time. This makes them work faster and the development process smoother.
  • Effortless Navigation: Shortcuts help you move easily between different parts of Developer Tools. This makes it feel smooth and easy to use.

How/When to use these Shortcuts?

  • During Development: Add shortcuts to your daily tasks. This will assist you in tasks such as checking parts, solving coding issues and observing network actions quicker.
  • Debugging Sessions: Shortcuts are really useful for fixing problems in code. They help programmers fast look at the code, slow it down in some spots and see things on a window called output for console.
  • Performance Optimization: Shortcuts are your friends when trying to make a website work well. Use their power in the Network Panel to show performance dragons and make sure your users have a smooth experience.

Steps to Use/Implement

  • Accessing Developer Tools: Enter the work area for making websites by right-clicking on your webpage, choosing “Inspect Element,” and going into the “Develop” list. You can also open the dev tools in safari by simply pressing option+command+c.
  • Navigating Panels: Shortcuts are your special spells to move between different panels like Elements, Console, Network and Sources. Move smoothly through these areas like a skilled keyboard player.
  • Inspecting Elements: Go to the core of your internet page using quick keys. Shine light on darkness with some easy button presses, looking carefully at different parts of the HTML like digital sleuth.
  • Executing JavaScript: Use the Console Panel, your secret door to the world of JavaScript. Shortcuts let you cast spells (do commands) easily. They turn your computer screen into a magic potion of great code wonders.
  • Monitoring Network Activity: In the Network Panel, shortcuts help you move through digital traffic. Follow requests, look at answers and make your computer run better with just a press of the keyboard.

Real Life Application

Picture a developer trying to solve the puzzle of an annoying layout problem on a website. Our programmer turns into a digital Sherlock with the help of shortcuts. Shortcuts help check parts of the webpage, move through it and change looks quickly. This helps solve problems. Pictures or small moving pictures show how shortcuts are used step-by-step. This is very helpful in figuring things out practically.

author

Please Login to comment...

Similar reads.

  • Geeks Premier League
  • Web Browsers
  • Geeks Premier League 2023
  • Best External Hard Drives for Mac in 2024: Top Picks for MacBook Pro, MacBook Air & More
  • How to Watch NFL Games Live Streams Free
  • OpenAI o1 AI Model Launched: Explore o1-Preview, o1-Mini, Pricing & Comparison
  • How to Merge Cells in Google Sheets: Step by Step Guide
  • #geekstreak2024 – 21 Days POTD Challenge Powered By Deutsche Bank

Improve your Coding Skills with Practice

 alt=

What kind of Experience do you want to share?

IMAGES

  1. Show Safari Web Developer Tools and how to dock them in Safari

    safari javascript dev tools

  2. Unlock the Power of Safari Developer Tools

    safari javascript dev tools

  3. Show Safari Web Developer Tools and how to dock them in Safari

    safari javascript dev tools

  4. javascript

    safari javascript dev tools

  5. 33 How To Run Javascript In Safari

    safari javascript dev tools

  6. Guide to Safari Developer Tools

    safari javascript dev tools

VIDEO

  1. Safari is AI Now!

  2. Cert Prep JavaScript Dev I Browsers, Async Programming, Server Side JavaScript

  3. AppleScript: Safari (Webautomation)

  4. İphone Javascript Etkinleştirme

  5. Browser Support and Fixing Flexbox Gap in Safari

  6. Safari+

COMMENTS

  1. Tools

    Web development tools. Apple has brought its expertise in development tools to the web. Safari includes Web Inspector, a powerful tool that makes it easy to modify, debug, and optimize websites for peak performance and compatibility on both platforms. And with Responsive Design Mode, you can preview your web pages in various screen sizes ...

  2. Use the developer tools in the Develop menu in Safari on Mac

    If you're a web developer, the Safari Develop menu provides tools you can use to make sure your website works well with all standards-based web browsers. If you don't see the Develop menu in the menu bar, choose Safari > Settings, click Advanced, then select "Show features for web developers.". See also Change Advanced settings in ...

  3. How to Activate the iPhone Debug Console or Web Inspector

    Here's how: Open the iPhone Settings menu. On an iPhone with an early version of iOS, access the Debug Console through Settings > Safari > Developer > Debug Console. When Safari on the iPhone detects CSS, HTML, and JavaScript errors, details of each display in the debugger. Scroll down and tap Safari to open the screen that contains everything ...

  4. Safari Developer Features

    Safari includes features and tools to help you inspect, debug, and test web content in Safari, in other apps, and on other devices including iPhone, iPad, Apple Vision Pro, as well as Apple TV for inspecting JavaScript and TVML. Features like Web Inspector in Safari on macOS let you inspect and experiment with the layout of your webpage ...

  5. Develop menu

    Overview. The Develop menu is home to the tools available to design and develop web content in Safari, as well as web content used by other applications on your Mac and other devices. The Develop menu also provides quick access to Changing Developer settings in Safari on macOS and Changing Feature Flag settings in Safari on macOS.. Note. If you haven't already enabled features for web ...

  6. Safari Browser Tips for Developers

    Here 's a quick guide to get you started: Enable Developer Tools in Safari by accessing Preferences > Advanced and checking 'Show Develop menu in menu bar'. Web Inspector helps you inspect and modify HTML, CSS, and JavaScript in real-time. Responsive Design Mode allows you to test your site on various device sizes.

  7. Safari Developer Tools: The Complete Guide for Web Developers

    These built-in tools provide web developers with capabilities for debugging JavaScript, inspecting CSS, monitoring network requests, analyzing performance, auditing accessibility, and more. Safari's developer tools are especially useful for testing and debugging web apps specifically within the Safari browser on macOS and iOS.

  8. Guide to Safari Developer Tools

    To enable Safari Developer Tools, open Safari, click Safari in your menu bar, and then select Preferences. You can also use Command-Comma keyboard shortcut to open Safari's Preferences dialog. Locate and select the Advanced menu. At the bottom of this menu you should see a checkbox that is labeled "Show Develop menu in menu bar".

  9. javascript

    On the ipad go to Settings > Safari > Advanced and activate the Web Inspector. Connect your ipad with your computer. On your computer open Safari, enable the developer tools in the settings. check the above menu for the tab Developer and find your iPad there. Full control via console from your desktop machine over the iOS Safari and you're done ...

  10. Debug Websites Using the Safari Developer Tools

    Safari Developer Tools is a set of web development tools built into Apple's Safari web browser. It allows developers to inspect, debug, and optimize their web applications. It has several components as follows: Inspector: It allows developers to inspect the HTML, CSS, and JavaScript code of a web page, as well as the network traffic and ...

  11. Safari Developer Tools: The Comprehensive Guide for Web Developers

    Introduction to Safari Developer Tools. Safari's built-in developer tools provide web developers with a powerful suite of features for testing responsive designs, debugging JavaScript, optimizing performance, and more. While historically Safari lagged behind Chrome and Firefox's devtools, modern Safari has caught up and offers a robust toolset ...

  12. How To Open Developer Tools On Safari

    Access the "Develop" Menu: Click on the "Develop" option in the menu bar. If you don't see the "Develop" menu, you may need to enable it first. To do this, go to "Safari" > "Preferences" > "Advanced" and check the box next to "Show Develop menu in menu bar." Open Developer Tools: Once you have accessed the "Develop" menu, you will find a list ...

  13. Safari

    Safari for developers. Safari is the best way to experience the internet on iPhone, iPad, and Mac. Thanks to blazing-fast performance and industry-leading energy efficiency, millions of users enjoy exploring the web with Safari. Take advantage of powerful new features, advanced developer tools, and cutting-edge technologies in Safari to deliver ...

  14. How To Get Developer Tools In Safari

    To enable Developer Tools in Safari, follow these simple steps: Open Safari Preferences: Launch Safari and navigate to the "Safari" menu located in the top-left corner of the screen. From the drop-down menu, select "Preferences." Access Advanced Settings: In the Preferences window, click on the "Advanced" tab.

  15. What are browser developer tools?

    Firefox: Select Web Developer Debugger or press Ctrl + Shift + S to open the JavaScript Debugger. If the tools are already displayed, click on the Debugger tab. Chrome: Open the Developer tools and then select the Sources tab. (Opera works the same way.) Safari: Open the Developer Tools and then select the Debugger tab.

  16. Live JavaScript edit in Safari?

    The closest option is to pause JavaScript and execute commands from the console. To open Safari dev tools, press Ctrl Alt C on Windows or command option C Mac. Or enable Safari dev commands in the menubar in Safari Preferences -> Advanced -> Show Develop Menu. See Apple's docs on how to use its dev tools. Unlike in Chrome, the Safari debugger ...

  17. Safari Dev Tools: The Complete 2023 Guide

    Its integrated developer tools provide everything web developers need to build, debug and optimize websites for Apple's ecosystem. In this comprehensive tutorial, we'll cover key capabilities of Safari's dev tools including: The Web Inspector for inspecting page structure and CSS. The Debugger for stepping through JavaScript code.

  18. Changing Developer settings in Safari on macOS

    Disable site-specific hacks. On rare occasions, when a particular website does not work correctly in Safari, modifications are made in browser code to get that site to work. This setting disables such modifications to make it possible for the site's developers to debug their problem. If there are no site-specific hacks, this setting has no ...

  19. WebKit Features in Safari 18.0

    And learn all about how to use Safari's developer tools on Mac to inspect and debug in Apple Vision Pro by reading Try out your website in the spatial web. ... JavaScript. WebKit for Safari 18.0 adds support for Unicode 15.1.0 characters in RegExp. Unicode 15.1 added 627 characters, bringing the total of characters to 149,813. ...

  20. javascript

    Yes, it posible, first you have to enable the Inspect Element: here a tutorial: Choose Safari > Preferences, and click Advanced. At the bottom of the pane, select the "Show Develop menu in menu bar" checkbox. then open the Inspect Element and go to the 'Sources' tab. here you will see the Breakpoints and start play.

  21. Shortcuts for Safari Developer Tools

    The Safari developer mode consists of a suite of tools meant to help web developers design, troubleshoot, and speed up their websites and Web apps. These functions contribute towards refining web development by incorporating measures that can be used to examine, revise, or evaluate web content. The bulk of Safari Developer Mode is composed of Safar

  22. Open Safari / Google Chrome developer tools programmatically from

    I'm looking for a way to open the WebKit "developer tools" from a script attached to a web-page. I need solutions for both Google Chrome and Safari, that will open the developer-tools pane if it's not already open, and (hopefully, if you can figure out how) also switch to a particular tab/section of said pane upon opening.