There is something wrong with WKWebView. it crash. that:
- (void)viewDidLoad {
[super viewDidLoad];
[self.wkwebView evaluateJavaScript:@"navigator.userAgent" completionHandler:^(id _Nullable result, NSError * _Nullable error) {
}];
}
crash info
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Incident Identifier: 2430792E-CF51-4EF1-94CF-EC72AC601B2C
CrashReporter Key: 50bcb858d8f2af8c94fc75188b8a740c78e148ff
Hardware Model: iPhone11,6
Process: Youkui4Phone [956]
Path: /private/var/containers/Bundle/Application/198201AE-A0DE-4E8F-B84A-2209122A5783/Youkui4Phone.app/Youkui4Phone
Identifier: com.youku.YouKu.InHouse
Version: 11.1.13.8339 (2042174090)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.youku.YouKu.InHouse [600]
Date/Time: 2024-12-17 16:11:51.5863 +0800
Launch Time: 2024-12-17 15:47:19.4488 +0800
OS Version: iPhone OS 18.1.1 (22B91)
Release Type: User
Baseband Version: 7.00.00
Report Version: 104
Exception Type: EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: FRONTBOARD 2343432205
<RBSTerminateContext| domain:10 code:0x8BADF00D explanation:scene-update watchdog transgression: app<com.youku.YouKu.InHouse(EEEC9FA9-AFA2-4648-B178-EFFB7C9FE91D)>:956 exhausted real (wall clock) time allowance of 10.00 seconds
ProcessVisibility: Foreground
ProcessState: Running
WatchdogEvent: scene-update
WatchdogVisibility: Foreground
WatchdogCPUStatistics: (
"Elapsed total CPU time (seconds): 13.120 (user 13.120, system 0.000), 22% CPU",
"Elapsed application CPU time (seconds): 2.732, 4% CPU"
) reportType:CrashLog maxTerminationResistance:Interactive>
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x1e503ff90 __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x21d17aa50 _pthread_cond_wait + 1204
2 JavaScriptCore 0x1ab495ce8 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 1900
3 JavaScriptCore 0x1ab4852e4 WTF::LockAlgorithm<unsigned char, (unsigned char)1, (unsigned char)2, WTF::EmptyLockHooks<unsigned char>>::lockSlow(WTF::Atomic<unsigned char>&) + 216
4 JavaScriptCore 0x1ac413cc0 JSC::JSLock::lock() + 568
5 JavaScriptCore 0x1ac45d0f0 JSC::JSRunLoopTimer::Manager::timerDidFireCallback() + 808
6 JavaScriptCore 0x1ab49e218 WTF::RunLoop::TimerBase::start(WTF::Seconds, bool)::$_0::__invoke(__CFRunLoopTimer*, void*) + 96
7 CoreFoundation 0x194cda894 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32
8 CoreFoundation 0x194cda538 __CFRunLoopDoTimer + 1012
9 CoreFoundation 0x194cda08c __CFRunLoopDoTimers + 288
10 CoreFoundation 0x194c793b4 __CFRunLoopRun + 1856
11 CoreFoundation 0x194c78830 CFRunLoopRunSpecific + 588
12 GraphicsServices 0x1e0c581c4 GSEventRunModal + 164
13 UIKitCore 0x1977deeb0 -[UIApplication _run] + 816
14 UIKitCore 0x19788d5b4 UIApplicationMain + 340
15 Youkui4Phone 0x105160fcc main + 56
16 dyld 0x1ba666ec8 start + 2724
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
We are developing an Add To Wallet flow on our website where we add the "Add To Wallet" button to a user portal for them to be able to add a loyalty card pass to their Apple Wallet.
In other projects with Apple Pay, we can check whether or not the browser supports the JS library by checking if it exists on the global window property (if (window.ApplePaySession) { //do stuff }
Is there an equivalent to determine if the user's device is capable of accepting a Wallet pass?
Hi, my iOS app using plugin.Firebase for google SSO. But the SSO show me a list of account which login previously, I can login with those account without inputting password. Anyway I can clean up the list or force to enter password? Thank you.
We enabled WebGPU feature flag on Safari on iOS 18.2. This does give Safari an access to GPU but WKWebView still doesn't have GPU access.
Can WKWebView not access GPU through Safari feature flag? Is there some other mechanism through which we can enable GPU access for WKWebView?
We are testing gpu access by loading : https://webgpureport.org/
Regards
Saalis Umer
Microsoft
Safari Feature Flag - webgpu = true
Safari GPU Access:
WKWebView GPU Access:
After updating Xcode to the latest version we observed that SFSafariViewController is not loading web pages on Xcode 16 Simulator with iOS 18, whenever it is presented the View Controller is empty (does not load any content) and the app freezes, but other screens that use WKWebView are working normally.
Also, during tests on physical devices with iOS 18 it seems to work just fine, so it might be just a IDE version problem.
Is anyone experiencing the same issue?
If so, did anyone find a solution for it?
Update: turns out the testphone with iOS 18 was set to 'Do not disturb'.
Case closed.
Hi all, I created a progressive web app. I is hosted on an actual live domain, served over https.
When installed on an iPhone homescreen on iOS 17.7.2, sending web push notifications works fine:
the response from the push service endpoint has a status code of 201, indicating all is good. In the service worker of the PWA, an eventlistener for the 'push' event is trigggered and displays an OS notification.
On iOS18.0 however, even though the response from the push service endpoint has a status code of 201, there is no notification showing. Even though permission has been granted, and registration.pushManager.subscribe() is successful.
When working locally, I've setup my server to run on localhost in https mode as well by following this excellent Technical Note to setup my own Certificate Authority, have it be trusted by my iOS test devices and have the CA issue a certificate so TLS can be set up.
On this locally running https server, web push notifications do arrive for iOS 17.7.2, but also not for iOS18.0.
I'm not sure how to start debugging this, as I can't seem to get the webinspector to show for the service worker most times, and when I can, there is no console.log() output visible.
This still stands:
So really, I'm looking for a (reliable) way to be able to debug this issues in safari, or find some documentation on what changed for Safari on iOS 18 that requires changes.
Any help or thoughts on this matter?
We are having an issue on our website whilst using Iphones. A soon as the page loads it crashes and the it seems A problem repeatedly occurred to display page. This has been happening lately.
This is the link. Can someone tell us what could be the issue?
https://www.showshappening.com/TheTravellers/Travellers-Concert-2024
Thanks
After updating my phone to iOS 18.2 2 days ago, I noticed that a website I'm working on that uses Rafael JS(https://dmitrybaranovskiy.github.io/raphael) to do some svg rendering which used to work before I updated just stopped working.
I notice that Safari tries to load website tries to load 2 or 3 times before showing the error: A problem repeatedly occurred on <website> which I find really odd since this used to work before and I haven't made any changes to the code.
This also happens in Chrome on iOS 18.2.
I am currently publishing an application that uses WebView,
I am currently publishing an application that uses WebView, but I am having trouble with data in LocalStorage sometimes disappearing.
The website displayed in WebView is made with PHP,
By writing the following code in JavaScript,
When WKWebView is opened, localStorage is saved and retrieved.
window.localStorage.setItem('isAlreadyAgree', true);
window.localStorage.getItem('isAlreadyAgree');
The problem is that sometimes this getItem does not get the data.
・This is not reproducible and does not always occur when some process is performed.
・Is it possible that the storage of the application is cleared due to distribution using MDM?
・Is it possible to store too much data in UserDefault, which would cause the LocalStorage space to be overwhelmed and disappear?
I would appreciate any hints you can give me.
Thank you in advance.
When using WKWebview to load the following html on iOS17.5 Simulator, navigator.mediaDevices.getUserMedia reports an error (A MediaStreamTrack ended due to a capture failure), but the then branch can be executed. The video cannot be loaded. There is no problem with iOS17 Simulator and iOS18 Simulator. Thank you very much for answering the question.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no, viewport-fit=cover">
<title>WebKit Camera Preview</title>
</head>
<body>
<div id="content" style="margin-top:env(safe-area-inset-top);background-color:blue">
<button style="width:200;height:40px;" onclick="doClick()">open camara</button>
</div>
<video playsinline id="myVideo" ></video>
<script>
var ggstream = null
function doClick(){
const content = document.getElementById("content")
content.style.backgroundColor = "red"
navigator.mediaDevices.getUserMedia({
video : true})
.then(stream => {
const video = document.getElementById('myVideo');
video.srcObject = stream;
video.play()
})
.catch(err => {
console.error('Error accessing media devices.', err);
});
}
</script>
</body>
</html>
Hi,
When we using Safari on MacOS with IPv6 we found that the XSRF-TOKEN can be set into the cookies. We have set-cookie in the authentication response headers 'Set-Cookie: XSRF-TOKEN=*******; SameSite=Strict; Secure'.
It works by using Safari with IPv4. And also works with Chrome/FireFox with IPv4/IPv6. And also worked with Safari 15.6.1 over IPv6.
May I know if this an issue or by design? Anyone aware of this?
Thanks.
Hi everyone,
I’m working on an app that uses WKWebView. Due to security concerns, our customers want the app to disable copy-paste functionality and similar options (such as Lookup and Share, allowing users to extract text from the app or save it as a file.
I was able to disable copy-paste and remove UIMenu options like Lookup and Share.
Everything worked fine until the iOS 18.1 beta, which introduced a new menu called Writing Tools (Apple Intelligence) that has its own copy and share buttons
I've tried several ways to remove it
Remove all UIMenu items using canPerformAction, and it works for all menus but Writing Tools, which still remains
override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool {
return false
}
Remove it from UIMenuBuilder
override func buildMenu(with builder: UIMenuBuilder) {
builder.remove(menu: .lookup)
builder.remove(menu: .share)
}
But unfortunately, UIMenuBuilder does not have an identifier for Writing Tools, and it seems like there are no API changes from Xcode 15 to Xcode 16 (https://developer.apple.com/documentation/uikit/uimenu/identifier)
It seems like the only way to disable it through MDM configuration (key: allowWritingTools), but we don't use MDM
https://developer.apple.com/documentation/devicemanagement/restrictions
Environment
iOS Version: iOS 18.1 beta4
Device: iPhone 15 Pro
App platform: iOS
Xcode version: 16.0
MacOS: 15.0
Thank you
Hi Team,
We’re encountering an issue where Open Graph metadata (e.g., og:image) isn’t rendering properly on iOS/macOS platforms or WhatsApp previews. Here’s a brief summary of the problem:
SSL Configuration: Our SSL Labs report shows a grade of B due to:
Improper certificate chain setup.
Outdated cipher suites (e.g., TLS_RSA_WITH_3DES).
Support for deprecated TLS protocols (1.0/1.1).
Frontend Observations:
Metadata (e.g., og:image) is not reliably picked up on iOS/macOS crawlers.
Crawlers may have issues accessing assets due to CORS or TLS limitations.
What We Need:
Guidance on resolving Open Graph preview issues specific to iOS/macOS environments.
Best practices for ensuring compatibility with Apple’s crawlers and WhatsApp on iOS.
Suggestions for optimizing server-side SSL/TLS configurations and frontend setup to improve metadata visibility.
We’re currently using Next.js 14 for the frontend. Any insights or debugging tips are greatly appreciated!
Thanks in advance!
How to handle it? regular downloads I already go working through Navigation and download delegates
Hello,
Do notifications works on a PWA who are in a European iPhone ?
Regards
Ed
I am working on some open source documentation genereator tools which should support pwa on apple.
I want to check whether some private apple meta tags are still supported like apple-touch-icon, I can only found some archived docs:
https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html
I searched for almost an hour but I can not find anything related to safari and it's behavior in the new documentation.
So I want to ask: do I miss anything? or apple is dropping docs for safari?
Hi everyone,
I'm developing a minimal Safari web extension for macOS and trying to implement "Sign in with Apple" directly from the extension popup, as per Apple's guidelines it's prohibited to open a new tab/window:
Guideline 4.0 - Design: The user is taken to a new Safari window or tab to sign in or register for an account, which provides a poor user experience.
What I've Done So Far
Created an App ID with "Sign in with Apple" enabled and configured.
Created a Service ID with the "Sign in" feature enabled.
Enabled "Sign in with Apple" for native targets in Xcode
Added the following JavaScript code in my popup.html file to initialize the Apple JS API and handle authentication via a popup:
<script type="text/javascript" src="https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js"></script>
<script>
// have tried many different configurations here - nothing works!
AppleID.auth.init({
clientId: '<valid client ID>',
redirectURI: '<valid URL>',
usePopup: true,
});
document.getElementById('sign-in-button-apple')
.addEventListener('click', () => {
AppleID.auth.signIn().then((response) => {
console.log('Success', response)
}).catch((error) => {
console.error('Error', error)
});
});
</script>
I also added event listeners for AppleID events:
document.addEventListener('AppleIDSignInOnSuccess', (event) => {
console.log('Success', event);
});
document.addEventListener('AppleIDSignInOnFailure', (event) => {
console.log('Error', event);
});
Issue
When I click the "Sign in" button in the popup, a native macOS dialog appears for authorization. However, after confirming sign-in, the modal just closes and no response (success or error) is logged in the console.
Expected behavior
To receive a success message or an error in the console about the authorization process result.
Questions
Service ID Configuration: Since the popup's location URL is safari-web-extension://<random-url>, I can't add it to the supported redirect URLs in the Service ID settings. Is there a way to work around this?
Safari Web Extension Setup: Are there specific configurations required in Xcode to enable "Sign in with Apple" within a Safari web extension?
Sign-In Method: Am I correctly implementing the signIn method in the JavaScript code? Could there be any constraints or special considerations for running it within an extension popup?
I would greatly appreciate any guidance, examples, or documentation that can help resolve this issue.
Thank you in advance!
Styling overlap occurs between the input field style and the generated strong password field in Safari browser. Is there a way to completely override the original input field style with the styling of the filled strong password?
Hi,
We have configured WKAppBoundDomains and are using limitsNavigationsToAppBoundDomains to enable Service Workers, which works perfectly. However, we are now unable to load a WKWebView with any domain that is not included in the app-bound domains.
For these other WKWebView instances, we have explicitly set config.limitsNavigationsToAppBoundDomains = false, but it doesn’t seem to have any effect. We don’t require access to the restricted APIs enabled by app-bound domains for these instances—we simply want them to load and perform basic website functionality.
Is there a way to enable Service Workers selectively in some WKWebView instances while allowing others to remain unaffected by the App-Bound Domains restriction?
Thank you for your help!
Best regards,
Rose Ding
Hey there guys! I'm new to this, and have been learning JavaScript on Udemy. I'm trying to do everything inside of Safari, instead of using Chrome. But I'm stuck on something that I feel is kind of small, but has been nagging at the back of my brain. When I go to the 'Inspector Developer Tools' (command + option + i), then go to 'Sources', and go to 'Console Snippets', I'm trying to figure out how to delete any JavaScript files from the Console Snippets selection. In Chrome, when you navigate to the Chrome equivalent, if I right click on the file, there's an option to remove the file, but on Safari the only option I get is to Run Console Snippet. Does anyone know how to remove or delete a JavaScript file from the Console Snippets section in Safari? I have no extensions installed.