<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Разрешение экрана</title>
</head>
<body>
<script>
const
screenWidth = window.screen.width * window.devicePixelRatio,
screenHeight = window.screen.height * window.devicePixelRatio,
div = document.createElement('div');
div.textContent = `Разрешение экрана с учетом плотности (Retina): ${Math.round(screenWidth)}x${Math.round(screenHeight)}`;
document.querySelector('body').appendChild(div);
console.log(`Разрешение экрана с учетом плотности (Retina): ${Math.round(screenWidth)}x${Math.round(screenHeight)}`);
</script>
</body>
</html>