Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

365
Visualizações
How to detect device's screen resolution on macbook?

It's said that to calculate screen real resolution I need to multiply screen.width by window.devicePixelRatio. The thing is on one of my laptops it works perfectly fine, window.screen.width = 1280, multiplying by pixel ratio (2) = 2560, which is correct according to system information.

But on my second laptop screen.width = 1440px, and pixel ratio is 2, which gives 2880px in width, but in system information it's said my resolution is still 2560 x 1600.

So how do I calculate screen's resolution in this case?

screen.width

real resolution

PS: my second laptop is 13" macbook pro 2020

PPS: well, I realised it depends on my settings, and is there a way to know the device's resolution as my settings can vary?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

well, after some research I realised, that there's no way to get physical characteristics of displays, and device pixel ratio won't show the real css-to-physical pixels ratio

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda