Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

97
Vistas
Webshare API Javascipt: Preview shared image

I have the following Codepen: https://codepen.io/Jsbbvk/pen/vYeRBZy

const onClick = async () => {
  const blob = await (await fetch("https://source.unsplash.com/random")).blob()
  const file = new File([blob], 'img', {type: blob.type})
  navigator.share({title: 'image', text: 'image', files: [file]})
}

document.getElementById("share").addEventListener("click", onClick)

On mobile, this is what it looks like when you press the button image sharing

There is no preview of the image before sharing it. Below is the intended result (which was achieved by long-pressing a random image and pressing "share") intended
Is there a way to achieve this image preview?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I have tried this with a demo and come to the conclusion that this seems to be a limitation in Safari. It works fine with image preview in Android.

What I don't get is why it works in another demo (click the Share button and you see a preview), but not in the demo above. In Share 4 I tried to exactly reproduce what my code does, but it doesn't seem to work.

It may just be a WebKit bug, I honestly don't know what's wrong and different between the two demos.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda