Not TestedTesting not done, may not work properly
Clipboard & Sharing

File Sharing

Verify navigator.canShare() file sharing support and pass File objects to native share target.

Checking support...
Advertisement

Interactive Input Workspace

Ready for input

Web API Execution Output

Result output will be displayed here after processing...

Native JavaScript Code Example (Zero Libraries)

const file = new File(['hello'], 'hello.txt', { type: 'text/plain' });
if (navigator.canShare && navigator.canShare({ files: [file] })) {
  await navigator.share({ files: [file] });
}

About the File Sharing Web API

navigator.canShare checks whether specific File arrays can be broadcast via Web Share API.

Specification:W3C & WHATWG Web API Standard
Sponsored Content