To reproduce this bug:
Create a simple Safari App Extension using the SFSafariWindow.getAllTabs method
Open a few tabs in Safari and save them to a named tab group
Quit Safari with Command + Q
Open Safari and navigate to the saved named tab group (do not navigate to other tabs, those non-active tabs will be suspended until we navigate to them)
Trigger the SFSafariWindow.getAllTabs method in our Safari App Extension
Ideally we should get all tabs in the tab group of the window, but instead we only get the active tab
Did I miss anything to make it work as expected?
Explore the integration of web technologies within your app. Discuss building web-based apps, leveraging Safari functionalities, and integrating with web services.
Post
Replies
Boosts
Views
Activity
If I store a wep page as WebApp on MacOS, as described here:
https://support.apple.com/de-de/104996
I cant use any Safari plugins in that WebApp
How to use plugins? is it blocked by MacOS/Safari generally? Does the Safari Plugin/Extension need to support this explicitly?
Hi - Any suggestions on how I add my website into my Xcode App Build, using Xcode 13.4?
Hi,
I'm trying to convert a chrome extension to a safari extension and I have some unsupported permissions that don't work in safari. They are
chrome.enterprise.networkingAttributes
and
chrome.enterprise.deviceAttributes
Is there a way to get the ip address of the device in a Safari extension. The page we use this in is written in typescript.
Thank you
Hello everyone, i want to set transparent status bar (where wifi and time), in my pwa app, writing on html, using manifest.manifest and sw.js, i make:
and this not work, i am want but this work on ios 15-17.xx, who know, how do setup this variable?
On my MacBook Air, when using the trackpad to zoom in on a Safari screen containing a textarea with a two-finger gesture, there is occasional flickering of the textarea border when typing.
macbook air Model:MacBook Air 2022 M2
iOS version:14.0(23A344)
Safari version:17.0(19616.1.27.211.1)
Hi! I'm having this crash on the app, it only happens in production and I haven't been able to reproduce it. I attacedh the full crash report and here is the code for the decidePolicyForNavigationAction action:
func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
guard let url = navigationAction.request.url else {
decisionHandler(.allow)
return
}
var policy: WKNavigationActionPolicy = .allow
if (["tel", "sms", "facetime"].contains(url.scheme)
|| navigationAction.navigationType == .linkActivated
&& initialUrl.host != url.host)
&& UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url)
policy = .cancel
}
decisionHandler(policy)
}
Can someone help me find out what could be then cause for this isse?
CrashReport
Hi, after the upgrade to Safari 17 the Mouse Over text, is not popping up any more.
At least not in graphics.
When inspecting the Element, the <g cursor="pointer" aria=label='text..' is there, but it is not doing anything.
How to activate this again?
Thanks
Currently I am using Objective-C and embedding a React website into the WKWebview. I have a component with scroll function and I also have some text description with an input component in the scroll function component. If the input component is shown all and I onClick the input component for inputting value in it, it works normally. However, when the input component shows only half of it and another half is hidden by the scroll component (Because it scrolls to see only half of the input component), it will triggers an unexpected issue that the WKWebview will have a white bar on the bottom and it will keep exists and affecting my UI. I have checked with web inspector that it is outside of the tag. Therefore, seems it is related to the issue with the external keyboard behaviour.
Please provide some suggestion if anyone have any idea on this topic. Thanks a lot
Is there a way to pass/read cookies from SFSafariViewController to my application?
My team is attempting to use an an add-in for Outlook for Mac that stores a Microsoft account access credentials in safari, so that it can refresh the credentials in the background and not force users to manually re-login every time the credentials expire. The update to safari that prevents local storage has prevented this from working correctly. It appears that the local storage prevention policy can be disabled with this command:
'defaults write com.apple.Safari BlockStoragePolicy -bool false'
This initially seemed to work but no long seems to be allowing the credentials to be stored. I was unable to find any documentation as to what exactly this command does. I wanted to see if anyone knew exactly what this command does and if there is a variation or alternative command that would make local storage in safari allowed again.
Description
I've seen this issue when I use WKWebView in SwiftUI. If I have 2 web views at once in a SwiftUI view, it produces unwanted console warnings that seem to be not solvable on client side.
The warnings aren't present when there is only 1 web view.
Similar warnings regarding the "running board" or RBSAssertionErrorDomain are reported by others as well.
Please advice how to dismiss these warnings in the app. Thank you.
Repro Steps and Code
Create a new iOS project.
Put the following code into ContentView.swift. It wraps a WKWebView in SwiftUI and display some dummy html data in the web views.
Build and run the app.
Tap the info button.
Drag down or dismiss the sheet. Upon dismiss, in the console it prints the error messages attached below.
import SwiftUI
import WebKit
struct ContentView: View {
@State private var isInfoViewPresented = false
@State private var selectedIndex = 0
func makeErrorHTML(index: Int) -> String {
#"<!doctype html><html><h1 style="text-align: center;">Unable to display README.</h1></html>"#
}
var body: some View {
VStack(spacing: 8) {
Text("Hello, world!")
Button {
isInfoViewPresented = true
} label: {
Image(systemName: "info.circle")
.imageScale(.large)
}
.sheet(isPresented: $isInfoViewPresented) {
sheetContent
}
}
}
var sheetContent: some View {
NavigationStack {
ZStack {
WebView(htmlString: makeErrorHTML(index: 0))
.background(Color(uiColor: .systemGray))
.opacity(selectedIndex == 0 ? 1 : 0)
WebView(htmlString: makeErrorHTML(index: 1))
.background(Color(uiColor: .systemGray2))
.opacity(selectedIndex == 1 ? 1 : 0)
}
.toolbar {
ToolbarItem(placement: .principal) {
Picker("Information Mode", selection: $selectedIndex) {
Text("0").tag(0)
Text("1").tag(1)
}
.pickerStyle(.segmented)
}
ToolbarItem(placement: .confirmationAction) {
Button("Done") {
isInfoViewPresented = false
}
}
}
}
}
}
struct WebView: UIViewRepresentable {
/// The HTML to load in the web view.
let htmlString: String
func makeUIView(context: Context) -> WKWebView {
// Creates an empty web view.
let webView = WKWebView(frame: .zero)
// Sets the web view's navigation delegate.
webView.navigationDelegate = context.coordinator
return webView
}
func updateUIView(_ webView: WKWebView, context: Context) {
// Loads the given HTML string.
webView.loadHTMLString(htmlString, baseURL: nil)
}
func makeCoordinator() -> Coordinator {
Coordinator()
}
class Coordinator: NSObject, WKNavigationDelegate {
func webView(
_ webView: WKWebView,
decidePolicyFor navigationAction: WKNavigationAction,
decisionHandler: @escaping (WKNavigationActionPolicy) -> Void
) {
switch navigationAction.navigationType {
case .linkActivated:
if let url = navigationAction.request.url, UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url)
}
decisionHandler(.cancel)
default:
decisionHandler(.allow)
}
}
}
}
OS Version
iOS 15 - iOS 17 Simulator and Device
Xcode Version 15.0.1 (15A507)
macOS 14.1.1 (23B81)
Similar Posts
@eskimo shared information about runningboard in this post: https://developer.apple.com/forums/thread/702207
https://developer.apple.com/forums/thread/709919
https://stackoverflow.com/questions/69902932/error-acquiring-assertions-what-is-that
https://developer.apple.com/forums/thread/708801
Error From Console
Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}>
0x11e024780 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'XPCConnectionTerminationWatchdog' for process with PID=85,796, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}
Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}>
0x11e0247e0 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'WebProcess NearSuspended Assertion' for process with PID=85,796, error: Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}
Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}>
0x11e0248a0 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'WebProcess NearSuspended Assertion' for process with PID=85,797, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}
Problem Description:
In the current scenario, I am dealing with a website platform that lacks traditional APIs for service access. To circumvent this limitation, the mobile application necessitates hosting a "web server" locally on "ws://127.0.0.1:****". The idea is that the website, loaded in a WKWebView, should establish a WebSocket connection with the locally hosted server. The responsibility for creating this WebSocket lies with the loaded website.
I am utilizing "Telegraph" to set up the local server within the iOS application. To verify the functionality of the local Webserver, I attempted to establish a WebSocket connection to it outside of the WKWebView, and the connection was successfully established.
Question:
Despite the success of the direct WebSocket connection outside of WKWebView, I am encountering difficulties when attempting to establish the same connection within the WKWebView. Is this approach even feasible? If it is, could you kindly point out any potential oversights or provide guidance on what might be missing in my implementation? Your assistance in resolving this matter is greatly appreciated.
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.
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.
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.
Static resources on my website do not use the cache-control header. (without cache-control header)
Recently, we have been receiving a lot of issues from iOS 17 users that seem to be related to cache.
Has the default cache-control header changed in Safari on iOS 17?
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: ""
}
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?
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.