From d8908e01ead5b114dcc28cde70785d387d96e0b7 Mon Sep 17 00:00:00 2001 From: schlagmichdoch Date: Thu, 8 Feb 2024 00:46:51 +0100 Subject: [PATCH] Add alert for iOS when receiving big files using a private tab --- public/scripts/network.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/scripts/network.js b/public/scripts/network.js index 540c7b5..482de81 100644 --- a/public/scripts/network.js +++ b/public/scripts/network.js @@ -1799,9 +1799,12 @@ class FileDigester { } processFileViaMemory() { + // Loads complete file into RAM which might lead to a page crash (Memory limit iOS Safari: ~380 MB) + if (window.iOS && this._totalSize > 250000000) { + alert('File is bigger than 250 MB and might crash the page on iOS. To be able to use a more efficient method use https and avoid private tabs as they have restricted functionality.') + } Logger.warn('Big file transfers might exceed the RAM of the receiver. Use a secure context (https) to prevent this.'); - // Loads complete file into RAM which might lead to a page crash (Memory limit iOS Safari: ~380 MB) const file = new File(this._buffer, this._name, { type: this._mime, lastModified: new Date().getTime()