Contents

Safari web extensions

Create web extensions that work in Safari and other browsers.

Overview

A Safari web extension adds custom functionality to Safari using JavaScript APIs and common file formats from extensions for Google Chrome, Mozilla Firefox, and Microsoft Edge browsers. While Safari app extensions are useful for sharing code between your native macOS app and Safari, you build Safari web extensions primarily on JavaScript, HTML, and CSS, and can repackage them to work in other browsers. You can also use Safari web extensions in Mac web apps.

To get started with creating a Safari web extension, use one of the following options:

  • Package your existing extension into a Safari web extension, so you can use it in Safari in macOS, visionOS, and iOS and distribute it. Xcode includes a command-line tool to simplify this process.

  • Build a new Safari web extension in Xcode using the built-in template. You can then repackage the extension files for deployment in other browsers.

  • Temporarily install your web extension in Safari for testing without packaging it or setting up an Xcode project. For more information, see Temporarily install a web extension folder in macOS Safari.

Learn more about the capabilities of web extensions and the APIs you use to build them in Mozilla’s Browser Extensions documentation.

Safari web extensions are available in macOS with Safari 14 and later, visionOS 1 and later, and iOS 15 and later. Safari web extensions are available in Mac web apps in macOS 15 and later.

Topics

New extensions

Extension conversions and packaging

Extension updates

Checking extension state

Messaging

Blocking content

Adding Web Inspector tools

Extension improvements

Installation and distribution