I tried to use "user-scalable=no" in the meta tag to disable zooming on mobile webpage, but it's not working on Safari. Therefore I tried to use javascript (code below) to control it, but it also failed. Is there another way to disable zooming of Safari?
document.addEventListener('touchstart', (event) => {
if (event.touches.length > 1) {
event.preventDefault();
}
}, { passive: false });
let lastTouchEnd = 0;
document.addEventListener('touchend', (event) => {
const now = (new Date()).getTime();
if (now - lastTouchEnd <= 300) {
event.preventDefault();
}
lastTouchEnd = now;
}, false);
}```