Allowing Web Share on Third-Party Sites
Starting with Safari Technology Preview 160, the W3C Web Share API no longer works inside third-party iframes unless the embedding page grants permission with an allow="web-share" attribute. An origin can optionally be specified. All major browser engines agreed to the change for privacy and security reasons and are rolling it out. Without the attribute, calls to the API throw an exception. Developers embedding third-party content that uses sharing must update their iframe markup following Permissions Policy syntax.
Related posts
- New WebKit Features in Safari 15.4
WebKit mediumAdeptSafari 15.4 ships over 70 WebKit additions, led by the <dialog> element with ::backdrop, lazy-loaded images, the :has() parent selector (shipped first in Safari), Cascade Layers, CSS containment, and new small/large/dynamic viewport units (svh, lvh, dvh and friends) that fix mobile viewport sizing. Other web platform additions include BroadcastChannel, Web Locks, structuredClone, Array at()/findLast(), Object.hasOwn(), and several Intl API upgrades. Web apps gain manifest-declared icons and ServiceWorker Navigation Preload. Security changes add CSP Level 3 features such as 'strict-dynamic' and remove the XSS Auditor, and many -webkit- prefixed properties now have unprefixed equivalents.
- Badging for Home Screen Web Apps
WebKit mediumAdeptWebKit on iOS and iPadOS 16.4 supports the W3C Badging API, but only for web apps added to the Home Screen. It is not exposed in Safari or WKWebView. Badges appear only after the user grants notification permission, and users can still hide badges in Settings without the app being told. The post shows feature detection, requesting and checking notification permission, `navigator.setAppBadge()` and `clearAppBadge()`, and updating badges from a Service Worker on push events. A badge update alone does not satisfy the user-visible notification requirement, and calls from cross-origin frames are ignored.
- Web Push for Web Apps on iOS and iPadOS
WebKit mediumAdeptiOS and iPadOS 16.4 beta 1 adds standards-based Web Push for Home Screen web apps, using the Push API, Notifications API and Service Workers over Apple Push Notification service, with no Apple Developer Program membership required (allow *.push.apple.com). Permission must be requested in response to direct user interaction, and notifications integrate with Focus, which syncs across devices via the newly supported manifest `id` combined with the user-chosen app name. The release also adds the Badging API, lets third-party browsers offer Add to Home Screen through UIActivityViewController with a WKWebView, opens Home Screen bookmarks in the default browser, and generates monogram fallback icons. Sites already using feature detection for Web Push on Safari 16.1 for macOS should work unchanged.
- News from WWDC24: WebKit in Safari 18 beta
WebKit mediumAdeptSafari 18 beta ships 48 new web platform features, 18 deprecations and 174 bug fixes across iOS 18, iPadOS 18, visionOS 2 and macOS Sequoia betas. Headline additions include immersive WebXR on visionOS with transient-pointer input and hand tracking, the View Transitions API, CSS Style Queries for custom properties, and currentcolor and system color keywords in Relative Color Syntax. Further additions are display-property transitions, the safe alignment keyword in Flexbox, content-visibility, and unprefixed backdrop-filter. Mac web apps can now open matching links based on their manifest scope and support extensions, and the Fullscreen API on visionOS can present spatial photos and panoramas immersively.
- News from WWDC23: WebKit Features in Safari 17 beta
WebKit mediumAdeptSafari 17 beta brings 88 web features. Mac users can add any website to the Dock as a web app: cookies are copied over and web push and badging are supported. The release also adds experimental <model> and WebXR (immersive-vr with hand tracking) for Vision Pro, JPEG XL and HEIC image support, image-set() type arguments, and the power-efficient Managed Media Source API for adaptive streaming. HTML gains the popover attribute and <hr> in <select>, CSS gains @counter-style and expanded font-size-adjust, and each feature comes with code examples showing usage and fallbacks.