Hello,
I’m encountering a problem with WebSocket connections in Safari on iOS 18.1 and later when initiated from an iframe. The same implementation works perfectly in other browsers like Chrome but fails in Safari.
In Safari, the WebSocket connection fails with error message
"WebSocket connection to 'wss://MY_CONNECTION_URL' failed: The internet connection appears to be offline."
Has anyone else faced this? Is this a known limitation or bug in Safari? Any workarounds or solutions would be greatly appreciated.
Thank you!
Safari and Web
RSS for tagEnable web views and services in your apps.
Posts under Safari and Web tag
144 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
It's being a very long time that I discovery that in some web pages, that use function requestAnimationFrame will cause a lot of cpu, but very little in Chrome. I have already submitted this bug nearly two years ago without printout requestAnimationFrame, no one replied. I submitted again and mention requestAnimationFrame recently, hope there will be some response. If anyone interested in this issue and know some tech in javascript please help. You can enter https://www.baidu.com/ and click one of the topic in all the 百度热搜 which have 弹幕滚动(using requestAnimationFrame, and cause a lot of cpu usage) on right.
When I'm inspecting a WKWebView in a simulator and the WKWebView loads a local URL with a port number, I've found that most features of Safari dev tools that worked in iOS 17 are broken in iOS 18. Here are the steps I'm taking:
Set up a WKWebView with isInspectable = true that loads a local URL, e.g. https://www.local.mydomain.com:3000
Install a self-signed SSL certificate on a simulator for www.local.mydomain.com
Run my app on the simulator
The WKWebView loads successfully
In Safari on my Mac, I can select the WKWebView and open dev tools to inspect it
If the simulator is on iOS 17, this works fine, no issues.
But if the simulator is on iOS 18, Safari dev tools are mostly broken. I can tell that there is a connection to the WKWebView because the Network tab logs the requests that I expect. But I cannot use any of the other dev tools features: Elements, Sources, Console, etc.
Has anyone else encountered this? Is there a workaround?
Hello there I have a nested USDZ file I had created a long time ago with some make-up products.
Its behaviour was always the same in the past: nested usdz files allow you to control each object "nested" separately. So I used this as a way to allow people to play around with a "set of objects".
Today I went to try it and since I'm on ios 18 it shows an "assets tab" on the bottom that allows me to see all the assets inside the tab but doesn't allow me to see or anchor them at all!
What changes do I need to do in order for this to work and where can I check documentation on these new behaviours for USDZ files? And what will this allow for in the future?
Thank you in advance
I’m trying to understand how the Reddit app knows to open in its anonymous mode when a link is opened from Safari’s Private Browsing mode.
Does Safari explicitly pass any flag or metadata indicating the request originated from Private Browsing?
Or is it inferred by the absence of shared cookies, session tokens, or other stateful data?
If the detection is based on the absence of cookies, could this logic misidentify other stateless scenarios as ‘private’?
It is outrageous that Apple continue to fail to implement the Fullscreen API web standard for web apps on iPhone only, which is so important to accessibility and web app functionality.
The only possible reason for this block is commercial: to promote iOS apps instead of browser based web apps.
To quote a client from a major agency just now - a typical enquiry :
We value accessibility greatly, and we noticed that the embedded player is missing a full screen button on iPhone.
Everything else works perfectly fine, including a full screen button that appears on the mobile webpage on android devices.
Is there any way we can include a button to enable full screen view for our viewers in your player that are going to watch it on iOS devices?
To which, as usual, we have to reply:
Apple unfortunately block fullscreen mode from being used with all web applications on iPhone.
Apple will allow this to be displayed fullscreen on MacBooks and iPads, but currently not on on iPhone - so we have to hide the fullscreen button there.
So fullscreen works on all devices and browsers apart from on iPhone.
As you've seen with Android, all other devices and browsers follow the universal 'Fullscreen API' web standard to allow full screen.
You're probably familiar with seeing the fullscreen button on normal linear videos on iPhone.
These use Apple's native video player, which doesn't let buttons and scripts be used on top of it - just a single video, not an interactive web application.
Our player looks like a video player but it is actually a web app combining multiple different video clips connected together by code and styling.
They block it on iPhones for reasons known only to them, but the assumption is that it is to incentivise people to make iOS apps instead of web apps.
The web development community is hopeful that Apple will change this unfortunate restriction soon, but we have been waiting a long time in vain.
We have to send this to a lot of people. It's a very bad look for Apple.
In less than a month it will be 2025. We have been waiting years for this.
The web standard documentation showing universal support on other devices and browsers is here:
https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API
This is not acceptable. It is time for Apple to stop blocking this important accessibility web standard for commercial reasons - only on iPhone. To whoever is in charge of these decisions in the Safari/Webkit team: Please just enable Fullscreen API for web apps on iPhone as soon as possible.
i use navigator.mediaDevices.getUserMedia to wake up camera, when i use constraint with '{video:{facingMode: {exact: 'user'}}}',occur a error"invalid constraint"
I have the following setup:
Managed domain (pdfforge.org)
Managed app (Dropbox) with Files app integration.
This can also occur with the following setup:
A custom browser is installed as managed (ex Firefox)
No managed domains
Managed app (Dropbox) with Files app integration.
Trying to upload a file from Dropbox in this managed domain by clicking on the Dropbox folder causes the folder to disappear and instead I am rerouted to the On My Phone directory.
On subsequent tries, sometimes the folder opens and I can see the files, but while scrolling the files disappear.
This makes it unable to upload any files from Dropbox to this managed domain.
If both the managed app and domains are not set up, then everything works normally.
Is this happening to everyone else? I also tried with Nextcloud and Google Drive.
When I want legend inside the filedset, not on the border as default browsers design, I set float: left to the legend. It works in every modern browser - Safari too. The problem is when the filedset itself is set to display: flex. Float propertie of the legend is ignored. In other browsers this approach works fine and the float stays and the legend is inside of the fieldset as we expect.
Hello.
Environment
Safari version 18.1 (22B81).
Problem
In my Safari Web Extension i need to determine the url of the active tab.
I do it this way:
const onError = (error) => {
console.error(error);
};
const getFrameUrl = async (frames) => {
console.info(frames)
};
const getAllFrames = (frames) => {
browser.webNavigation.getAllFrames({ tabId: frames[0].id }).then(getFrameUrl, onError);
};
browser.tabs.onUpdated.addListener(() => {
browser.tabs.query({ currentWindow: true, active: true }).then(getAllFrames, onError);
});
The problem is that if the tab url is a link in the blob protocol, then the result function browser.webNavigation.getAllFrames({ tabId: tabs[0].id }) is as follows:
{frameId: 0, parentFrameId: -1, url: "", errorOccurred: false}
In Safari version 17 the correct URL value was returned:
{frameId: 0, parentFrameId: -1, url: "blob://<some id>", errorOccurred: false}
How can I fix the problem?
Environment
Safari version 18.1 (22B81).
Hi,
iOS 18.1 Safari 18 does not play HLS/.m3u8 audio tracks (while all previous iOS Safari still do).
If I turn on the Web Inspector toggle and put it on, restart Safari/ refresh the page, the player works.
Before filing a bug, are you already aware of such behavior or some way to deal with it?
Starting Safari 18, Declarative Net Request redirections are no longer working (it used to be working on Safari 17). It seems to be related to the regex validation that is not working as expected.
Here is an example of our DNR rule:
{
priority: 1,
action: {
type: 'redirect',
redirect: {
regexSubstitution: `${scheme}//${extensionHost}/index.html\\1#/\\2`,
},
},
condition: {
// app.dashlane.com, *.app.dashlane.com
regexFilter: '^https?://w*\\.?app\\.dashlane\\.com(\\??[^/#]*)[^#]*#?/?(.*)$',
resourceTypes: [
'main_frame'
],
},
}
Is it a known issue ?
Also, it seems to be related to this existing issue:
https://forums.developer.apple.com/forums/thread/763505
We recently converted an existing app to adopt scenes (for CarPlay). The app has one main view controller that presents a WKWebView to show our content. Everything works fine in both landscape and portait mode when swiping on the screen to scroll. But with an iPad using an external Magic Keyboard, once you rotate to landscape mode the scrolling gestures are reversed. Swiping vertically on the trackpad is scrolling the page horizontally and vice versa. When this happens an error like below is logged (this error also shows up when in portait mode, but scrolling works as expected):
Unexpected window orientation: <UIWindow: 0x10370d8f0; orientation: landscapeLeft (4)> {
hidden = NO;
frame = {{0, 0}, {1180, 820}};
bounds = {{0, 0}, {1180, 820}};
ownsOrientation = NO;
ownsOrientationTransform = NO;
autorotationDisabled = NO;
windowInterfaceOrientation = unknown (0);
rootTransformOrientation = landscapeLeft (4);
viewTransformOrientation = unknown (0);
autorotationDisabled = NO;
orientationVC = ... {
providedSupportedOrientations = ( Pu Ll Lr Pd );
resolvedSupportedOrientations = ( Pu Ll Lr Pd );
canPreferOrientation = NO;
};
}, event type: 6
It seems to suggest that while the view controller orientation is set correctly. It doesn't know what the orientation is for the window. I have been unable to figure out what would change with adopting scenes that would explain this behavior. I assume it has to do with the potential multi-window nature of it but haven't found any docs that describe how to ensure the window is setup to use the same orientation as the device. Any suggestions on things to check?
The specification states that the timestamp property is a DOMHighResTimeStamp which always represents a value in milliseconds. However, in my testing (on iOS as I don't have a mac) the timestamp is given as seconds. This could break compatibility if an app/library is not tested in Safari.
Worse is that the deviation seems to be undocumented as every compatibility chart states full compatibility and defines the property as milliseconds.
Any workaround would also be up to one frame incorrect. So a stutter can affect input accuracy.
I know this might seem small but it could mean that an app or game is unplayable in Safari if it relies on this for input.
When a video in Safari is played in fullscreen mode and the user pauses it, an overlay (such as a play button or other controls) appears. This affects the user experience, as we want to avoid showing the overlay during fullscreen viewing after the video is paused.
Expected Behavior:
The overlay should not appear after the video is paused in fullscreen mode.
Steps to Reproduce:
Open a webpage https://slides-dev.pitchavatar.com/rtxuf in Safari.
Start playing the video.
Enter fullscreen mode.
Pause the video.
The overlay appears after the video is paused.
Screenshot:
Additional Information:
Safari version: Safari 18.0.1 (20619.1.26.31.7)
Environment: macOS Sequoia 15.0.1 (24A348)
We would like to know if there is there any way to prevent the overlay from appearing in Safari when the video is paused in fullscreen mode.
Description:
When using a multilingual keyboard that includes Korean in iOS 18, the input element's onChange event is triggered multiple times instead of just once. This issue occurs not only when entering numbers with input type="tel" or inputMode="numeric", but also when entering text with input type="text". This causes unexpected behavior in forms and other input-related functionalities.
Affected Devices and OS Version:
Device: iPhone 16 Pro
OS Version: iOS 18.0
You can reproduce the issue with this CodeSandbox example:
https://codesandbox.io/p/sandbox/elegant-dream-jnqh39
Steps to reproduce:
Use a multilingual keyboard (e.g., Korean and English) on iOS 18.
Type some text into the input field (input type="text").
Also try entering numbers using input type="tel" or inputMode="numeric".
Observe that the onChange event is fired multiple times for both text and numeric input.
Expected behavior:
The onChange event should only be triggered once when text or numeric input changes.
Additional Information:
This issue has been reported under feedback ID FB15377631. Currently waiting for a response from Apple regarding this feedback.
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
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?
In Safari Web Extensions on iOS 18, declarativeNetRequest Rulesets and Dynamic Rules take over twice as long to apply -- which causes rulesets to often fail to apply before sites load. In a boilerplate Xcode project you can note the time difference toggling the OISD (https://oisd.nl) ruleset on iOS 17 and iOS 18 simulators. Additionally, if you force quit Safari and reopen to a site with ads blocked by OISD list (e.g. espn.com) the content will be blocked in that initial state on iOS 17, but not in iOS 18 due to the latency.
Based on the boilerplate extension, this bug is impacting all Mobile Safari Extensions using declarativeNetRequest Rulesets and Dynamic Rules. We know several other extension developers dealing with this issue.
Our team wrote detailed reproduction steps in our Feedback Assistant ticket: https://feedbackassistant.apple.com/feedback/15196130 but have received no responses. I would attach a screen recording here but it won't allow me.