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

iOS Web Apps - Notification.permission reports as "default", after tapping on a notification that uses clients.openWindow
One Line Summary Notification.permission is incorrectly reported as "default" on iOS App Webs, this happens when tapping on a notification that results in a new "window" being opened via clients.openWindow. Why this is is important to fix This is confusing to the end-user as sites will check Notification.permission and see it is "default" and then attempt to show the end-user a soft notification permission prompt again. Steps to reproduce the issue On a iOS 16.4 or newer device open https://ios-webapp-notification-new-window-permission-bug.glitch.me in Safari Tap share button Tap "Add to Home Screen" Open the iOS Web App you just added Tap "Prompt Notification permission" On the iOS native notification permission prompt press "Allow" Tap "Display notification" Tap on the notification [Safari/iOS Bug] Observe Notification.permission reports as "default" when it should be "granted" What devices are affected I have reproduce this issue on an iPhone 14 Pro on both iOS 16.7.2 & 17.1.2. However I would expect all iOS 16.4+ devices to be effected.
0
1
582
Dec ’23
How to release a JSValueRef created by JSObjectMakeTypedArrayWithBytesNoCopy?
Hi I use JSObjectMakeTypedArrayWithBytesNoCopy(JSContextRef ctx, JSTypedArrayType arrayType, void *bytes, size_t byteLength, JSTypedArrayBytesDeallocator bytesDeallocator, void *deallocatorContext, JSValueRef *exception) to create a JSObjectRef, and [JSValue valueWithJSValueRef: inContext:] to create a JSValue. I then pass the JSValue to the JSContext. I have noticed that even if I don't pass the JSValue to the JSContext, the JSTypedArrayBytesDeallocator is always called after the deallocation of the JSContext. In my understanding, it should be released by the JS garbage collection when there are no references to it. Since I have a large amount of data to pass to the JSContext, if the JSTypedArrayBytesDeallocator is called too late, it may cause memory issues. Where am I mistaken in this case? Thanks.
0
0
527
Dec ’23
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
648
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: "" }
4
1
1.3k
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
661
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
327
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
716
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
617
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
540
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.4k
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
577
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
462
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
759
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
404
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
1.1k
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
337
Dec ’23