Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

94
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!