My app Frax has long used a mechanism where a local webpage calls out to web-hosted content. In iOS 17.5+ (and iOS 18 beta) this has recently stopped working. The content fails to load, and the console log (running on iOS 17.6.1) contains:
nw_application_id_create_self NECP_CLIENT_ACTION_GET_SIGNED_CLIENT_ID [80: Authentication error]
Failed to resolve host network app id
followed shortly by:
Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "((target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.rendering AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.networking AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.webcontent))" UserInfo={NSLocalizedFailureReason=((target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.rendering AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.networking AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.webcontent))}>
0x128024480 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'XPCConnectionTerminationWatchdog' for process with PID=9736, error: (null)
This same code has worked reliably for years, and continues to work properly under iOS 16 and earlier. But there are increasing reports of this new error showing up around the web. Nothing in recent iOS 17 release notes sheds any light on what might have changed, and all my efforts to troubleshoot or mitigate this issue have failed. Any help on how to solve or work around this would be greatly appreciated!
General
RSS for tagExplore 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
Hi Folks,
do you know what happend with the "shape detection API" feature flag on Safari 18.X (IOs 18.X)?... in previous versions (17.X) i enabled the "shape detection API" feature flag and was able to detect codes like mentioned here...
https://developer.mozilla.org/en-US/docs/Web/API/Barcode_Detection_API#browser_compatibility
I built a PWA (Service Worker) with Angular 18 and facing this issue immediately after updating to IOS 18.0 (I enabled/disabled the flag, restartet the device several times... no success at all)
Do you have an Idea what changed or how i can enable that feature again?
Thx a lot in advance..
Cheers Martin
Hello,
I am facing a strange issue on iOS 18. After upgrading to iOS 18, I noticed the following problem:
When connected to mobile data (with Wi-Fi turned off) and trying to upload a file larger than 1MB, the connection times out. However, if I repeat the same action using Wi-Fi, everything works fine.
I have tested this issue in various ways, but nothing seems to resolve it. It appears that iOS 18 might have introduced a bug.
You can replicate the issue using this site: https://video.online-convert.com/convert-to-mp4 (Note: this is not my page, but I found the same issue here).
From the server access logs, I see successful pre-flight requests, but the main POST request never follows, which suggests that the client is not sending the request.
Hello I am having issues where when I open a link to YouTube in a wkwebview it opens up the installed YouTube app. I have tried my own way of blocking the opening of the YouTube app but it seems I'm stuck.
Is there a way to prevent certain apps from opening automatically from links clicked on or traveled to?
Here is what I have so far.
guard let url = navigationAction.request.url else {
decisionHandler(.cancel)
return
}
//not sure why this code is not being used...
// Check if the navigation is a link click with target="_blank"
if navigationAction.targetFrame == nil {
// Handle the navigation request to open a new window
if let url = navigationAction.request.url {
// UIApplication.shared.open(url) //opens in safari....
let request = URLRequest(url: url)
webView.load(request)
decisionHandler(.cancel)
return
}
}
// Continue with the navigation if not a link with target="_blank"
if url.scheme == "youtube" || url.scheme == "music" {
decisionHandler(.cancel)
return
}
//this should cancel app opening for youtube:// links and apple music.
// if let url = navigationAction.request.url {
// // Allow Google sign-in redirects
// if url.absoluteString.contains("accounts.google.com") || url.absoluteString.contains("gstatic.com") {
// decisionHandler(.allow)
// return
// }
// }
if url.absoluteString.hasPrefix("http") {
decisionHandler(.allow)
return
}
if let url = navigationAction.request.url {
if shouldDownloadFile(from:url) {
// if navigationAction.navigationType == .other, let mimeType = navigationAction.request.allHTTPHeaderFields?["Content-Type"], mimeType.contains("application/pdf") {
downloadFile (from: url)
decisionHandler(.cancel)
return
}
}
decisionHandler(.allow)
}
Hi!
I have a rather complicated SwiftUI browser app with a WKWebView. There is an option to reload the website after a configurable amount of time. Starting with iOS 18, the app crashes after repeated reloads. How many reloads that are required depends on the device, sometimes 100, sometimes 1000.
Reloading is done via a timer that triggers the following code on the main thread:
let request = URLRequest(url: url, cachePolicy: policy)
self.parent.webView.load(request)
The URL is configurable and cachePolicy can be either .reloadIgnoringLocalAndRemoteCacheData or .useProtocolCachePolicy
How the crash affects the device also differs from device to device and from time to time. I have suffered from the following crashtypes:
App is killed
App is killed and Safari also stops working
App is killed and the whole OS is really slow
The WKWebView stops loading and hangs at 20%.
The device is rebooted
My app has an option to disable cache. Cache is disabled by setting cachePolicy to .reloadIgnoringLocalAndRemoteCacheData and by removing all cache in a rather complicated way.
Basicly i'm doing something like this:
dataStore.removeData(ofTypes: types, modifiedSince: Date.distantPast, completionHandler: nil)
if let klazz = NSClassFromString("Web" + "History"),
let clazz = klazz as AnyObject as? NSObjectProtocol {
if clazz.responds(to: Selector(("optional" + "Shared" + "History"))) {
if let webHistory = clazz.perform(Selector(("optional" + "Shared" + "History"))) {
let o = webHistory.takeUnretainedValue()
_ = o.perform(Selector(("remove" + "All" + "Items")))
}
}
}
if let cachesPath = NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true).first {
let contents = (try? FileManager.default.contentsOfDirectory(atPath: cachesPath)) ?? []
for file in contents {
if foldersToDelete.contains(file) {
let path = cachesPath.appending("/").appending(file)
do {
try FileManager.default.removeItem(atPath: path)
} catch {
print("Can't delete cache file: \(path), error: \(error.localizedDescription)")
}
}
}
}
The cache state affects the intensity of the crash. Disabling the cache shortens the time the app is working, while enabling the cache reduces the intensity of the bug.
Based on my investigation, I suspect that loading a website in a WKWebVew leaks memory in iOS 18. If the whole website needs to be requested (= caching off), it results in a more significant memory leak and a faster crash time.
Is this a known issue? Am I doing something wrong? Is there a potential workaround?
When I run the following code in XCode iOS Simulator on Safari (connecting via Safari DevTools):
navigator.serviceWorker.ready.then((reg) => reg.pushManager.subscribe({ userVisibleOnly: true, applicationServiceKey: "..." }).then((sub) => console.log(sub.toJSON())))
I get the response:
{ keys: { p256dh: "", auth: "" } }
But I'm expecting p256dh and auth (and endpoint) to be filled out. Why is it not?
私たちはJavaアプリケーション開発者で、iPadOS上でのWebRTCによるカメラアクセスに関して、iPadOS 17.1での挙動について質問がございます。
具体的には、iPadOS 17.1でChromeブラウザを利用し、WKWebView API経由でカメラにアクセスしようとした際、エラーが発生し、カメラ撮影が実行できない現象が発生しております。弊社の調査では、WKWebView APIのnavigator.mediaDevicesプロパティを通じたデバイスアクセスが、Chromeで動作しない可能性が示唆されました。しかし、Safariブラウザでは正常に動作するため、Chromeに固有の制限があるのか、またはiPadOSの設定や仕様に起因するのか判断しかねております。
現在、iPadOS 17.1でのカメラアクセスに関するWKWebViewとWebRTCの仕様やChromeでの制約について、ご見解や解決策についてご教示いただけますと幸いです。
どうぞよろしくお願いいたします。
I need to implement push notifications in Safari. I already have a web app that can be added to the home screen.
When researching push notifications in Safari, one of the things I found was that you don't need to be part of the Apple Developer Program to use this feature (text here).
But when checking the requirements within the platforms, such as Pusher, they require a type of certificate that can only be generated with a paid account, that is, I need to participate in the Apple Developer Program.
Pusher documentation: https://pusher.com/docs/beams/getting-started/web/configure-safari/
Now, I have many questions:
Do I really need a paid account to issue the certificate?
Can I issue the certificate via the web or only on a Mac?
Do I really need this certificate?
Hello!
I have a question about changes in default behavior of Safari related to cookie setting.
We had an issue - our Single Sign On login was not working, because of lost cookie on some step of the flow. Only changes in Safari cross-website tracking settings helped to fix the issue
So the question is - are there any official documentation about changes in cookie setting policy in Safari on iOS 18?
Hi, i embedded vimeo video on the website and alreay make it allowfullscreen. However, when i open chrome/firefox on Ipad, the vidoe not showing fullscreen. Also on iPhone, when exit the fullscreen video. It doesnt hide the iframe element. Initially, i hide the iframe and implement button so that when user click on it, the video will display full screen
I have been using the following python library to generate apple map snapshots. has worked fine until about ~12 hours ago - now all I'm getting is "bad request" for any snapshot with overlays. if it's just a snapshot with a defined center and no polyline overlays, it still works. perhaps something has changed with the api's way of parsing percent encoded parameters? it's super irritating that there's no changelog or source code to view.
what the heck???
https://pypi.org/project/mapsnap/
On my M3 MacBook Pro 14'' laptop, when using Safari responsive design mode I cannot see any simulators when choosing "Open With Simulator". I am on the latest Sequoia 15.1 and Xcode version is 16.1. However when I successfully run a simulator from Xcode (Developer Tools -> Simulator) I can see the simulator running in the "Open With Simulator" dropdown but I cannot click it to run it with my safari desktop. I can never link my desktop safari app to a simulator. I feel I have read almost every how to blog but have no more options left to get this working.
I've tried reinstalling Xcode and the iOS 18.1 environment on it, updating safari and anything else that might be out of date but still with no luck after much restarting programs and my machine. Is there another way to try and run a simulator from Safari?
Details at Stack Overflow
We're trying to enable Apple Pay on the Web for a web application of ours, but getting this error when trying to construct the PaymentRequest object:
TypeError: Type error: PaymentRequest@[native code] startApplePay@https:-myurl-:319:47 onclick@https://-myurl-:606:14:undefined
session.onvalidatemerchant = function(event) {
const validationURL = event.validationURL;
console.log("Validation URL:", validationURL);
document.getElementById('methodapplepay').value = "validate";
document.getElementById('validationURL').value = validationURL;
$.ajax({
url: 'ajax/processInternalDonate.php',
type: 'POST',
data: $("#payment_form").serialize(),
success: function(dataValidate) {
dataValidate = JSON.parse(dataValidate);
session.completeMerchantValidation(dataValidate);
},
error: function(xhr, status, error) {
console.error('Merchant validation failed:', error);
session.abort();
}
});
};
session.onpaymentauthorized = function(event) {
var payment = event.payment;
$.ajax({
url: 'ajax/processInternalDonate.php',
type: 'POST',
data: {pay_mode:"pay_mode",method:"process_payment",payment:JSON.stringify(payment)},
success: function(dataprocess) {
if (dataprocess.success) {
session.completePayment(ApplePaySession.STATUS_SUCCESS);
} else {
session.completePayment(ApplePaySession.STATUS_FAILURE);
}
},
error: function(xhr, status, error) {
console.error('Payment processing failed:', error);
session.completePayment(ApplePaySession.STATUS_FAILURE);
}
});
};
from this above two session methods for the first method I got the merchant validation response from the API calling from that method but for the session.onpaymentauthorized when the second API is calling then I got the message payment not processed on my apple pay popup upon autorisation from my phone so I want that you provide me the correct backend flow for this API calling so we get the amount charged and I also got the payment object from event.object on logging in my console.
As shown in the image, after the 18.1 update, the “Preview” pane in network requests disappeared. I can only view the response by right-clicking and selecting “Reveal in Sources tab”.
BEFORE:
AFTER:
Hey,
when I try to run my project on an iOS Simulator, I get the following message:
JournalingSuggestions is not available when building for iOS Simulator.
and
Linker command failed with exit code 1 (use -v to see invocation)
Steps to reproduce this behavior:
Create a new Xcode project
Add the Journaling Suggestions Capability
Add the Journaling Suggestions Framework
Under "Target > Build Phases > Link Binary with Libraries", select “optional“ for JournalingSuggestions.framework
Under "Target > Build Settings > Other Linker Flags > Debug" select „Plus“ and add „iOS or iOS Simulator“ and paste this -Xlinker -weak_framework -Xlinker JournalingSuggestions into the editable field.
Do the same for "Target > Build Settings > Other Linker Flags > Release"
This tread is about the same problem, but is already checked as answered.
That's why I'm creating this new tread.
The last two bullet points are results from advice from the other thread.
MacBook Air, M1, 2020, macOS: 14.6.1, Xcode: 16.0
Thanks for your help!
Got the wrong keywords, trying to create a new thread...
Since probably the late iOS 17.4.x, 17.5.1 and still now in 17.6 beta our extension has been experiencing issues with the accompanying background script or service worker being permanently killed with no warning after about 30-45 seconds after initial installation (installation, not page load!).
In all other browsers (including Safari on MacOS) unloading the service worker is part of the normal lifecycle to save memory and CPU if it is idle. In our extension the service worker is used only during the first 5-10 seconds of every page visit, so we are used to seeing it unload after that and consider this a good thing. However, normally, the service worker is able to wake back up when needed - which is no longer the case in iOS.
Once dead, nothing a normal user would do can wake the service worker back up:
No events like webNavigation or similar will trigger anymore
Any attempt to call sendMessage to it from a content-script also does not wake up the service worker and instead returns undefined to the content script immediately
Closing and opening Safari does not start it again
The only two things that will give the service worker another 30-40 seconds of life is a reboot of the device or disabling and then re-enabling the extension. During those few second the extension is working perfectly.
There are no errors or indications in the logs of what is going on and the extension works just fine in Chrome, Firefox, Edge as well as Safari on MacOS and Safari in the Mobile simulator. Only actual iOS devices fail.
It seems like a temporary workaround is to change the manifest to not load the service worker as a service worker by changing
"background": {
"service_worker": "service.js"
}
to
"background": {
"scripts": ["service.js"],
"persistent": false
}
With this change (courtesy of https://forums.developer.apple.com/forums/thread/721222) the service worker is still unloaded but correctly starts up again when needed. Having to make this change does not seem to be consistent with manifest v3 specs though (see this part in Chrome’s migration guide as an example: https://developer.chrome.com/docs/extensions/develop/migrate/to-service-workers#update-bg-field).
According to the release notes of 17.6 beta this bug was supposedly fixed:
“Fixed an issue where Safari Web Extension background pages would stop responding after about 30 seconds. (127681420)”
However, this bug is not fixed - or at least not entirely fixed. It seems to work better for super simple tests doing nothing but pinging the service worker from the content script, but for the full blown extension there is no difference at all between 17.5.1 and 17.6.
Has there been a change in policy about service workers and background scripts for Safari in iOS?
Are anyone else seeing this issue?
Also seemingly related:
https://forums.developer.apple.com/forums/thread/756309
https://forums.developer.apple.com/forums/thread/750330
https://developer.apple.com/forums/thread/757926
https://forums.developer.apple.com/forums/thread/735307
We are encountering an issue where the Safari extension we are developing stops working while in use on relatively new iOS versions (confirmed on 17.5.1, 17.6.1, and 18). Upon checking the Safari console, the content script is displayed in the extension script, so the background script or Service Worker must be stopping. The time until it stops is about 1 minute on 17.5.1 and about one day on 17.6.1 or 18.
When it stops, we would like to find a way to restart the Service Worker from the extension side, but we have not found a method to do so yet. To restart the extension, the user needs to turn off the corresponding extension in the iPhone settings and then turn it back on.
As mentioned in the following thread, it is written that the above bug was fixed in 17.6, but we recognize that it has not been fixed. https://forums.developer.apple.com/forums/thread/758346
On 17.5.1, adding the following process to the background script prevents it from stopping for about the same time as on 17.6 and above.
// Will be passed into runtime.onConnect for processes that are listening for the connection event
const INTERNAL_STAYALIVE_PORT = "port.connect";
// Try wake up every 9S
const INTERVAL_WAKE_UP = 9000;
// Alive port
var alivePort = null;
// Call the function at SW(service worker) start
StayAlive();
async function StayAlive() {
var wakeup = setInterval(() => {
if (alivePort == null) {
alivePort = browser.runtime.connect({ name: INTERNAL_STAYALIVE_PORT });
alivePort.onDisconnect.addListener((p) => {
alivePort = null;
});
}
if (alivePort) {
alivePort.postMessage({ content: "ping" });
}
}, INTERVAL_WAKE_UP);
}
Additionally, we considered methods to revive the Service Worker when it stops, which are listed below. None of the methods listed below resolved the issue.
①
Implemented a process to create a connection again if the return value of sendMessage is null. The determination of whether the Service Worker has stopped is made by sending a message from the content script to the background script and checking whether the message return value is null as follows.
sendMessageToBackground.js
let infoFromBackground = await browser.runtime.sendMessage(sendParam);
if (!infoFromBackground) {
// If infoFromBackground is null, Service Worker should have stopped.
browser.runtime.connect({name: 'reconnect'}); // ← reconnection process
// Sending message again
infoFromBackground = await browser.runtime.sendMessage(sendParam);
}
return infoFromBackground.message;
Background script
browser.runtime.onConnect.addListener((port) => {
if (port.name !== 'reconnect') return;
port.onMessage.addListener(async (request, sender, sendResponse) => {
sendResponse({
response: "response form background",
message: "reconnect.",
});
});
②
Verified whether the service worker could be restarted by regenerating Background.js and content.js.
sendMessageToBackground.js
export async function sendMessageToBackground(sendParam) {
let infoFromBackground = await browser.runtime.sendMessage(sendParam);
if (!infoFromBackground) {
executeContentScript(); // ← executeScript
infoFromBackground = await browser.runtime.sendMessage(sendParam);
}
return infoFromBackground.message;
}
async function executeContentScript() {
browser.webNavigation.onDOMContentLoaded.addListener((details) => {
browser.scripting.executeScript({
target: { tabId: details.tabId },
files: ["./content.js"]
});
});
}
However, browser.webNavigation.onDOMContentLoaded.addListener was not executed due to the following error.
@webkit-masked-url://hidden/:2:58295
@webkit-masked-url://hidden/:2:58539
@webkit-masked-url://hidden/:2:58539
③
Verify that ServiceWorker restarts by updating ContentScripts
async function updateContentScripts() {
try {
const scripts = await browser.scripting.getRegisteredContentScripts();
const scriptIds = scripts.map(script => script.id);
await browser.scripting.updateContentScripts(scriptIds);//update content
} catch (e) {
await errorLogger(e.stack);
}
}
However, scripting.getRegisteredContentScripts was not executed due to the same error as in 2.
@webkit-masked-url://hidden/:2:58359
@webkit-masked-url://hidden/:2:58456
@webkit-masked-url://hidden/:2:58456
@webkit-masked-url://hidden/:2:58549
@webkit-masked-url://hidden/:2:58549
These are the methods we have considered. If anyone knows a solution, please let us know.
Safari cannot open the page due to the error 'WebKit encountered an internal error.' We are using https://github.com/stleamist/BetterSafariView.git, and it was working fine before we updated to Xcode 16.