const originalFontSize = window.getComputedStyle(document.documentElement).fontSize;
Object.defineProperty(document.documentElement.style, 'fontSize', {
get: function() {
return originalFontSize;
},
set: function(value) {
if (window.innerHeight < window.outerHeight) {
return originalFontSize;
}
this._fontSize = value;
},
configurable: true
});
const originalResize = window.onresize;
window.onresize = function(e) {
if (window.innerHeight < window.outerHeight) {
requestAnimationFrame(() => {
document.documentElement.style._fontSize = originalFontSize;
});
} else if (originalResize) {
originalResize.call(window, e);
}
};
};
if (/Android/i.test(navigator.userAgent)) {
handleFontScale();
}