Can zip.js support safari browser unZip? #247
-
When I Quote u Zip.js ,I found it can work very well except iOS Safari Browser,it shows below. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
As I write this, Safari does not support if (DataView.prototype.getBigUint64 === undefined) {
DataView.prototype.getBigUint64 = function(byteOffset, littleEndian) {
// split 64-bit number into two 32-bit parts
const left = this.getUint32(byteOffset, littleEndian);
const right = this.getUint32(byteOffset+4, littleEndian);
// combine the two 32-bit values
const combined = littleEndian? left + 2**32*right : 2**32*left + right;
if (!Number.isSafeInteger(combined)) {
console.warn(combined, 'exceeds MAX_SAFE_INTEGER. Precision may be lost');
}
return combined;
};
} |
Beta Was this translation helpful? Give feedback.
-
@gildas-lormeau, i get the same issue but it is view.getUnit16 on safari. Can you tell me how to fix this? |
Beta Was this translation helpful? Give feedback.
As I write this, Safari does not support
DataView#getBigUint64
(see here) so it must be polyfilled if you want to read files using zip64. Here is below an implementation based on this response from Stack Overflow. You have to run this script before using zip.js.