• Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Precios
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

77
Vistas
Why does maximized Chrome report its display-mode as 'fullscreen'?

In my web app, I need to know whether I can open a new window or not (e.g. with target='_blank'). I can safely open a new window when running in a browser, but not when running as a PWA (in standalone mode).

To test whether I can open a new window, I'm using the display-mode media query, like this:

document.body.innerText = 'Your display-mode is ' +JSON.stringify(
  ['fullscreen', 'standalone', 'minimal-ui', 'browser'].filter(
    mode => window.matchMedia(`(display-mode: ${mode})`).matches))

This works in Firefox and Safari, which both report the mode browser. But Chrome, when its window is maximized, reports the mode fullscreen! This doesn't make sense, because the meaning of fullscreen is "All of the available display area is used and no user agent chrome is shown."

Questions:

  1. Is this a bug in Chrome? Should it not always report the mode browser?
  2. Is there a less hacky way I can test for the ability to open a new window?
9 months ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar empleo Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.