Post not yet marked as solved
I have a Safari App Extension that uses an instance of WkWebView to run JavaScript code. This app extension runs flawlessly with Safari 13 & 14, but Safari 15 occasionally kills the WkWebView instance for no apparent reason. The only thing logged to the console is this message:
(JavaScriptCore) Received an invalid message "<unknown message receiver>.<unknown message>" from the web process.
SafariExtension: (WebKit) [com.apple.WebKit:Process] 0x10c2e9300 - WebProcessProxy didClose (web process crash)
SafariExtension: (WebKit) [com.apple.WebKit:Process] 0x7ff1e7048020 - [pageProxyID=5, webPageID=6, PID=22131] WebPageProxy::processDidTerminate: (pid 22131), reason 3
I can't find any correlation between the JavaScript that's running and that error. The error seemingly occurs at random.
Has anyone else experienced such a problem?
Thanks
Post not yet marked as solved
On the payment screen of my website, I executed the canMakePayments method to check if the user has an ApplePay-enabled device.
The process worked fine, but when I executed the window.webkit.messageHandlers.xxxx.postMessage method in JS to do the following, the process stopped.
window.webkit.messageHandlers.***.postMessage
is it not possible to use it when using ApplePayJS?
Or is there some problem such as a restriction on the JS window object?
Post not yet marked as solved
The javascript code below fails when the xsl transformation passed to the importStylesheet contains xsl:include href= references. No exception is thrown and the transformToFragment function simply returns null. This works on all other browsers except Safari. For Safari all xsl:include href references must be manually resolved and inserted into the XSL transformation document prior to calling transformToFragment.
Is this a known bug? Is there a workaround aside from retrieving all xsl:include href manually?
//Opera, Firefox, Chrome, Safari ...
processor = new XSLTProcessor();
processor.importStylesheet(settings.xslDocument);
if(settings.param) {
for(var param = settings.param.length; param--;) {
processor.setParameter(null, settings.param[param].name,
settings.param[param].value);
}
}
transformedXML =
processor.transformToFragment(settings.xmlDocument, document);
Post not yet marked as solved
Hello
I have a webrtc-based web app that is loaded inside a WKWebView.
The web app gets loaded just fine in our iOS App running WKWebView on an iPad with iOS 15.1.
We are using the exact same app, built for Mac Catalyst. However, on the Mac version, the web app gets loaded but the RTCPeerConnection object is undefined.. Meaning that our web app assumes that WebRTC is not available in that browser.
Isn't the native app supposed to work the exact same on iOS and MacOS? Is the Mac version of WKWebView more limited than its iOS counterpart ?
Is there any resource that states exactly what is supported in WKWebview in each platform?
Thanks
Post not yet marked as solved
Hi Apple team,
I am using an API request to download a pdf (or a .doc) file from our servers. Most browsers support createObjectURL(blob), however for IE and EDGE , We have been using msSaveOrOpenBlob to save the blob data.
iOS Edge browser, however, neither does not support msSaveOrOpenBlob nor does respond to createObjectURL. So what should I do to download a file in iOS edge?
Thank you,
Koushik Kuppanna
Post not yet marked as solved
Hello, why i cant access to IndexedDB data, created by serviceworker, from DOM? It is different databeses? On all other browsers i can save data in ServiceWorker into IndexedDB and read it in Dom from IndexedDb with same name, But it not work on Mobile Safari, for what it not shared now?
Post not yet marked as solved
Hello, in IOS 15 apple-touch-startup-image no longer works How can I fix it?
Post not yet marked as solved
Hi,
I am working with an ios app which calls a survey Web app and displays a survey embedded in the ios app.
In the survey app I have setup a redirect url, but this is not working. The expected behaviour is that the webbrowser would open the url. But this is not triggering the browser to open.
The html code that I am using is a Windows.top.
Post not yet marked as solved
I have a game that is built as a PWA and the minute I add sounds that overlap, everything goes to pot on mobile. The sounds work perfectly on desktop, but on an iPhone X the behavior is drawing and sounds get randomly delayed and serialized. So even though on the desktop the visual of a block dropping is accompanied by the sound of a block dropping, on mobile I get one or the other first, and if I do 16 in a row, I'll get some set of each before or after one another (3 sounds, 8 visual animations, 6 sounds, 5 visual animations, 2 sound, 3 visual animations).
I'd rather not use a dependency like Howler.js, but have decided to do so.
I've tried both DOM audio elements and new Audio() objects in javascript. Nothing seems to make it better. Thoughts?
To see this in action - https://staging.likeme.games
Post not yet marked as solved
If you visit the website https://www.deutschlandfunk.de/ (or https://www.deutschlandfunkkultur.de/)
with Safari and browse for a while inside that domain (duration is not fixed neither
the amount of visited pages), images are not loaded any more (unless they are
already in cache). It seems to be necessairy to use the back button while
browsing to trigger that behaviour.
This issue occurs using the Safari browser on Mac as well as on IPhones and IPads.
On iOS it affects Firefox and Chrome too.
As soon as the issue occurs, any new image (e.g. image is not in cache storage) will not be shown.
"A while" can be a few hours. We were not able to find out any event that might be causing this issue.
Cached Images will be shown. Using the inspector you can see, that the browser tries to load the images, but nothing happens. There is no error or warning. It seems, that the request is not fired at all.
Copying the URL of an unloaded image to another browser tab does not load the image neither. Using another browser (on Mac system) loads the image in the other browser.
The issue is reproduceable using the incognito/private mode too.
It seems to be related to the browser session. It works in a newly opened window in private mode or after closing and reopening the browser again, as well in other browsers or with curl on the command line.
It is not related to JavaScript, we disabled JavaScript in Safari and the issue was still reproducible.
Once the browser is in this state, there is no way to load any images from nor do any requests (even for non existent resources) to assets.deutschlandfunk.de or assets.deuschlandfunkkultur.de until restarting it.
Clearing cache, cookies does not help, even after a waking the system up after a few days in sleep mode does not change anything
Thank you!
Post not yet marked as solved
In our web app, we use the MQTT library which internally uses a WebSocket for communications. In iOS 14 and earlier it was working fine. But in iOS 15 and macOS Monterey, WebSocket breaks when we try to send the first message.
Below are some findings from our research:
There is an experimental feature named NSURLSession WebSocket in Safari. This feature is by default enabled on iOS 15 and macOS Monterey. If we disable this feature, WebSocket seems to work fine.
We have also noticed that when the above-mentioned experimental feature is enabled, it seems to add some limit on the size of the message that we can send from a socket connection. If we try to send messages of more than 84 bytes, the socket connection breaks. If we try to send messages of fewer than 84 bytes it works fine.
Post not yet marked as solved
How do I disable double tap to Zoom in Safari iOS15.I am writing a progresive web app that uses btn.ondblClick Javascript but don't want my screen to Zoom when doing this. Any suggestions much appreciated
I want to put on 3D object on websites, but I don’t know how to do.
It doesn’t explain AR such as Apple’s product page.
It explain like top page’s earth of github.com.
In short, I want to put 3D object without page-jumping.
This question is maybe not adopted here -apple developer forum-, however I want someone to answer this.
Post not yet marked as solved
My app has a WKWebView which loads the certain HTML, CSS and JavaScript files. When the WKWebView is opened and files load initially, the memory usage of my app remains relatively low. If I start to use the application, in some time (5 mins) the total system free memory drops drastically and reloads the app. At that point the WKWebView reloads itself; there is no console message, no crash log, nothing. At most I'll see an Xcode message about my device having "BKSProcessAssertion 'ConnectionTerminationWatchdog' initialized with invalid pid".
The WKWebView has the markings of a memory leak and even if I remove the variables or objects their memory sticks around.
Is there some way to release any memory it's holding in order to avoid reloads of the app?
Post not yet marked as solved
Hi,
I'm using MediaRecorder for screen recording of canvas , along with audio.
simplified code to implement screen recorder
//intialise stream
const canvas = document.querySelector('.main-canvas');
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
for (let track of canvas.captureStream().getTracks()) {
stream.addTrack(track);
}
recorder = new MediaRecorder(stream);
chunks = [];
recorder.ondataavailable = ({ data }) => {
if (data) chunks.push(data);
};
recorder.start();
recorder.onstop = () => {
const videoBlob = new Blob(chunks, {
type: 'video/mp4'
});
chunks = []
//stop mic access after use
try{
for (let track of stream.getTracks()) {
track?.stop();
}
}catch(e){}
return videoBlob;
}
so when i call recorder.stop() , the recorder.onstop method is not getting called sometimes randomly.
And also in case when recorder.onstop is not called , recorder.ondataavailable is not called even a single time,So it returns empty Blob output.
This only occurs in iOS 15 device's , it occurs randomly 40% of the times.
Is there any workaround for this, or what is cause of this issue?
Thanks in advance
Post not yet marked as solved
I'm using this js package https://www.npmjs.com/package/idb to manage a simple indexedDB implementation on a web app.
I'm using the excellent https://www.npmjs.com/package/idb package to manage a simple indexedDB implementation on a web app.
I'm having this error "UnknownError: Database deleted by request of the user" reported to our error reporting system for a significant number of iOS users and I'm having trouble replicating.
It seems to have so far only affect users on:
Mobile Safari 14.6, 14.4.2, caught by try/catch
Instagram webview, iOS 14.7.1 - not caught be try/catch
I think the source of the error is this line in webkit https://github.com/WebKit/WebKit/blob/e98ff129bc8eba06ac17105f19c5f0e142aab853/Source/WebCore/Modules/indexeddb/shared/IDBError.h#L40
It seems to relate to the server connection closing. Can anyone help me understand what conditions are required to trigger this error so that I can replicate and try to handle in the app?
A simplified version of the implementation:
// ./store.js
import { openDB } from 'idb'
export const upgrade = (db) => {
if (!db?.createObjectStore) return null
db.createObjectStore('example_store_name_1')
}
export const set = async (storeName, val, key) => {
const dbPromise = openDB('example_db_name', 1, { upgrade })
if (!window.indexedDB) return null
return (await dbPromise).put(storeName, val, key)
}
export const count = async (storeName) => {
const dbPromise = openDB('example_db_name', 1, { upgrade })
if (!window.indexedDB) return null
return (await dbPromise).count(storeName)
}
// ./index.js
import { set, count } from './store.js'
export const storeEvent = async (storeName, value, key) => {
try {
const rowCount = await count(storeName)
// I process and clear the db in a separate part of the app, this count is just here here as a rough limit to
// ensure that I don't keep pushing data into storage if, for some reason, it is not getting cleared elsewhere
if (rowCount < 500) {
await set(storeName, value, key)
}
} catch (error) {
// error reported to error monitoring tool
}
}
Some of the things I have tried to replicate (on Instagram webveiw, iOS 14.7.1 or Mobile Safari 14.6):
saving a massive object to idb and closing or backgrounding Instagram or Safari mid transaction
saving a massive object to idb across multiple Safari tabs at the same time
manually deleting idb db from Safari while transaction is in progress - seems to generate either "UnknownError: * Connection is closing." or "AbortError: The transaction was aborted, so the request cannot be fulfilled." - both caught by try/catch
Safari incognito
Setting Safari privacy to store no cookies (or any other form of browser storage)
this transaction lifetime bug https://github.com/jakearchibald/idb#transaction-lifetime
... Google - nothing for this error other than the webkit source code.
Any suggestions appreciated. I'd like to understand particularly how it is triggered in the iOS webview (Instagram) as these errors are not caught by try/catch currently.
Post not yet marked as solved
Hello guys,
I need to store the resources of WKWebview while loading the web page. Is any other option to store resources?
If we are able to store resources, How we will retrieve and use that on the web page while loading?
Execute java script in ios15 system, h5 developers cannot get the value on the window.
System below ios15 is normal
Post not yet marked as solved
Hello community,
We noticed that the background video on our homepage is not playing when the iphone is in power save mode. A play icon appears but is not clickable. Same problem when we leave the page and come back to it with the "back" CTA of the browser. La vidéo est interrompu automatiquement.
I am a total beginner in development (that's why we build our site with shopify 😅 )
Do you know how to fix this problem?
Thanking you for your help 🙏
Best,
Post not yet marked as solved
We call webView evaluateJavaScript:javaScript completionHandler:^(id _Nullable result, NSError *_Nullable error) API to inject a javascript to WKWebView.
The javascript contains "window.***"definition.
Since iOS 15, "window.***" can not be found and it will return "undefined" when accessing "window.***" . It seems that javascript "window" object can not have any custom sub-object.
However same javascript code works fine on iOS 14.x and below.
Any ideas? Thanks!