Explore the integration of web technologies within your app. Discuss building web-based apps, leveraging Safari functionalities, and integrating with web services.

General Documentation

Post

Replies

Boosts

Views

Activity

Any way to keep a web extension alive to post messages to the page?
I am writing a midi polyfill, to bridge Core Midi with Safari. This, in itself, is not a problem. The problem is that the Web Extension will get suspended the moment it's no longer actively called. This means that no callbacks due to midi changes from core midi can be passed back to the web page. If I use a setInterval call in background.js, then this keeps the extension alive somewhat, but the setInterval self ping will get aborted eventually, making the Extension suspend itself. I know of a fairly contrived workaround using the container application over XPC, but I am hoping there is a way to keep the Web Extension alive - or at least keep a thread in the same process as the Web Extension alive. Or any such workaround. Setting background to "persistent": true does not seem to make any difference.
0
0
591
Dec ’23
Safari 17+: Image file got automatically converted to HEIC extension
Issue: The image file mime type got converted to HEIC by Safari To reproduce: Create an HTML file with <input type="file" accept="image/*,image/heic" /> Try to upload a photo with .jpeg or .png Print out the file object The file name would be changed to some temporary name with .heic extension Expected: The conversion should not happen after adding the image/heic to the accept mime type. The accept mine type with image/heic should be allowed and cannot be removed for other modern browsers which do not support .heic. Otherwise, the system browse dialog would disable .heic type. Other findings: If image/heic is removed from the accept mime type, the file object would be printed out as its original extension. It only happens with Safari 17+. Original file object: File: { lastModified: 1702417372000, name: "leo2.jpeg", size: 170584, type: "image/jepg", webkitRelativePath: "" } Converted file object: File: { lastModified: 1702417636000, name: "tempImageHjyd3l.heic", size: 170429, type: "image/heic", webkitRelativePath: "" }
2
1
1.1k
Dec ’23
JavaScript engine quietly fails in Safari and WKWebView if certain function names are used
Any page that has a JavaScript function named "top()" in it causes JavaScript to fail. The function doesn't need to be called or even contain anything. eg. function top() { } JavaScript just locks up. This affects iOS17.2 and macOS 14.2 If occurs in Safari and any app using WKWebView This is a critical bug that affects sites and apps in the wild. I suggest there is something very wrong with the Javascript engine in general if certain function names can cause such a failure. Does anyone else have other function names that cause this failure?
1
0
630
Dec ’23
Headphones issue with WKWebView video streaming IOS 17+
Hi, the application I maintain consists of WKWebView which gives you the ability to stream videos. Since iOS 17, when you disconnect the headphones on iPad, the stream stops working and cannot be restarted (regardless of whether it is the lightning or jack port). The only solution is to kill the application from the task manager and start it again. This situation does not occur for regular video. There is no error logs in console.
0
0
300
Dec ’23
Safari Security Vulnerability - CSP policy bypassed script on Safari while chrome successfully blocking it.
on our web pages we have allowed certain sources of scripts though content-security-policy meta tag which is working fine as expected on Chrome browser and on Internet Edge. However there is a script called morosa.top when it inserted in our html page, safari is not able to block it while it was supposed to block. if this script gets executed it start taking screenshots of screen and post it to hacker. Please check this could be a potential issue. [Edited by Moderator]
1
0
669
Dec ’23
By build is yet not approved
Its been more than 32 days that i have submitted by build and neither has it been rejected nor approved, i have emailed them but havent got any reply. The details of my app are as follows: App Name BigBatteryChatBot Upload Date Nov 14, 2023 at 11:17 AM Build SDK 20C52 Bundle Version String 1 Original File Name 458dfc10-e358-4424-870b-989edef3e8d7.ipa Bundle ID com.bigbattery.chatbotcustomer
0
0
573
Dec ’23
Flexbox item not appearing on Safari (iOS 17.1.2)
I have a Website live on http://chatwithsanta.azurewebsites.net/ It uses Flexbox to show chat messages and a chat message input. Specifically, the Body is a flexbox container with a message screen containing messages, and a message input form at the bottom. This layout works in Chrome on desktop, even when Chrome is set to simulate an iPhone 12 Pro layout. But the form does not appear on my own iPhone. What should I do?
0
0
501
Dec ’23
Safari 17 blocking my JavaScript SDK completely in Private Browsing Mode
Hi Safari team, I am a product manager working for a large content recommendation company. Our JavaScriot SDK is running on more than 9000 leading publishers worldwide and has been certified to be aligned with global legal and privacy regulations and guidelines. We have the following problem: Since the launch of Safari 17 (in iOS, iPadOS, and MacOS) - we can see our JavaScript SDK blocked when the user uses the private browsing mode Safari 17 sometimes identifies our loading and rendering JavaSctipt files as any request/action by our domain to be a tracking activity (we see the JavaScript files in the console tagged with “Blocked connection to known tracker” log) In previous Safari versions, we only got the tracking functionality blocked, allowing our content to render We have the following questions: Can JavaScript running in Safari detect the user has the privacy mode turned on? Was there something specific in Safari 17 “Tracking Protection” functionality that now blocks content rendering on the page in addition to tracking activity? Context: We can run our JavaScript without performing any form of tracking, either directly by my domain or any other 3rd party vendor we are working with. We will render our content without performing any form of tracking or fingerprinting We are already following Apple’s iOS IDFA guidelines. Our iOS SDK, for example, detects and respects when the user opts out from sharing the IDFA on an iOS app running our code. In that case, we show our content without breaching the App Tracking Transparency framework rules. Besides sponsored content, our JavaScript SDK also powers organic recommendations for our clients. With Safari 17 blocking anything in private browsing mode, we see unfair interference with organic engagement. Please let us know if you provide guidance to allow our JavaScript SDK to render content when the user uses the private browsing mode, adhering to the privacy requirements. Thank you for helping! Omri.
0
2
1.3k
Dec ’23
iOS 17 Safari dropped support for #canonicalWebPageURL links?
iOS 17 Safari will not successfully open .reality (Reality Composer) files from a weblink. For example, this code works fine on iOS 16: The same code generates this message on iOS 17 after clicking on the link: "Object requires a newer version of iOS." QuickLook fails to render anything. I validated that the .reality file works fine when opened from iOS 17 Files app, so it's not a damaged file.
0
1
545
Dec ’23
Safari memory leak when webgl scene dipose and rebuid serval times
I have created a scene using THREEJS that loads GLTF files and image-format tile maps. When I repeatedly destroy and rebuild the scene, I notice that the memory keeps increasing in the Safari browser, but the same code performs normally in the Chrome browser. I have ensured that I properly dispose of all relevant resources when destroying the scene. THREEJS Version: r138 Google Chrome Version: 119.0.6045.200 Safari Version: 17.0(19616.1.27.211.1) Is there anyone who can give me some advice? Thanks!!!
1
0
426
Dec ’23
Crash entering Picture in Picture from webview on Mac Catalyst or Made for iPad
Crash seems to be in a private Apple framework. There's some other reports of this floating around but no solutions so far. Any ideas? *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[WebAVPlayerLayer startRedirectingVideoToLayer:forMode:]: unrecognized selector sent to instance 0x6000037033c0' *** First throw call stack: ( 0 CoreFoundation 0x0000000187d56800 __exceptionPreprocess + 176 1 libobjc.A.dylib 0x000000018784deb4 objc_exception_throw + 60 2 CoreFoundation 0x0000000187e083bc -[NSObject(NSObject) __retain_OA] + 0 3 CoreFoundation 0x0000000187cc0a84 forwarding + 1572 4 CoreFoundation 0x0000000187cc03a0 _CF_forwarding_prep_0 + 96 5 AVKit 0x00000001bdc81f30 -[__AVPlayerLayerView startRoutingVideoToPictureInPicturePlayerLayerView] + 156 6 AVKit 0x00000001bdcf1d48 -[AVPictureInPicturePlatformAdapter(Common) _setRoutingVideoToHostedWindow:pictureInPictureViewController:source:] + 84 7 AVKit 0x00000001bdcd952c -[AVPictureInPicturePlatformAdapter startPictureInPicture] + 380 8 AVKit 0x000000022883000c -[AVPictureInPicturePlatformAdapterAccessibility startPictureInPicture] + 44 9 AVKit 0x00000001bdcddea0 -[AVPictureInPictureController startPictureInPicture] + 216 10 WebCore 0x00000001c75277c8 -[WebAVPlayerViewController startPictureInPicture] + 128 11 libdispatch.dylib 0x0000000102c64f14 _dispatch_call_block_and_release + 32
2
0
704
Dec ’23
WebGPU issue with unpack4x8unorm on Safari Technology Preview 185
Hi, With Safari Technology Preview Release 185 (Safari 17.4, WebKit 19618.1.9.8) the compiler seems to struggle with unpack4x8unorm() instruction (at least). https://www.w3.org/TR/WGSL/#unpack4x8unorm-builtin Repro code: https://skal65535.github.io/webgpu/bug_unpack.html This modified version of 'hello triangle' should display a single triangle but doesn't. Uncommenting line 51 makes the triangle appear. Actually, adding the instruction: _ = unpack4x8unorm(0xdeadbeef); anywhere in the code triggers the bug, no matter if the line is used or not. Tested on a MacBook Pro M1 Sonoma 14.2.1 (23C71) Works fine with Chrome 120.0.6099.109 (Official Build) (arm64)
1
0
374
Dec ’23
Immersive AR mode of WebXR in visionOS Safari
After enabling WebXR following instructions from https://developer.apple.com/forums/thread/732629, I can successfully run WebXR, but it is limited to VR. I cannot get AR running. If I try await navigator.xr.isSessionSupported("immersive-ar"), the result is false. But if I try await navigator.xr.isSessionSupported("immersive-vr"), the result is true. I double checked that I specifically checked the box "WebXR Augmented Reality Module" in the Safari feature flags. Any idea how to enable WebXR AR mode? Thanks in advance!
1
1
984
Dec ’23
Significant Safari 17.2.1 animation slowdown on MacOS 12.7.2
https://www.kardland.com uses Javascript and animation for playing a could solitaire card games. Playing FreeCell for example (https://kardland.com/freecell.html), initially the animation is okay as cards are auto-put-away for the player. But as the game continues it gets more and more sluggish to the point it becomes nearly unplayable. I have a 92MB screen recording but am apparently unable to attach to this post.
1
0
305
Dec ’23
chrome extension converted to safari, chrome.runtime.sendMessage does not work on iOS
My Chrome extension runs fine on Chrome, but when I use the following command to run it on Safari, I find that the result returned by chrome.runtime.sendMessage is always Undefined. xcrun safari-web-extension-converter --app-name MySafariTest dist The following is my code content.js: async test() { return chrome.runtime.sendMessage({ method: "test" }) } let result = await this.test() // result is always undefined background.js: chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { sendResponse("test123") }); I want to know if there is any way to make the content script and background script of Chrome communicate normally in Safari?
0
0
488
Dec ’23
Updating Safari content blocker from daemon
I'm building a Safari content blocker extension. The app is able to use SFContentBlockerManager.reloadContentBlocker to update the content blocker's JSON rules. However, I'm also trying to update the rules in the background through a daemon. The daemon app is embedded inside the main app, and is registered by the main app through SMAppService. The issue I'm running into is I can't get both the GUI app and the daemon to both update the content blocker: If I embed the Safari extension inside the main app and not the daemon, the main app is able to update the extension, but the daemon fails with an "operation couldn’t be completed" error (supposedly because it isn't the owner of the app) Alternatively, if I embed the extension inside the daemon, the main GUI app can no longer update the extension (also failing with "operation couldn't be completed" If I try to embed the extension inside both the main app and the daemon, it works fine when running from Xcode, but App Store Connect verification fails because it won't allow an bundle ID with two periods after the main app ID (e.g. the main app is com.example.App, the daemon is com.example.App.daemon, and the extension is com.example.App.daemon.extension) I'm wondering if I'm missing something here? Is there a way to get Safari to recognize both the main app and the daemon as "owners" of the extension? Thanks in advance!
2
1
506
Dec ’23