capacitor-community / capacitor-community/electron

Ability to Enable Chrome Experimental Features: Web Share

Open
#252 0 comments 5 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
398
Forks
63
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
`navigator.share() is not a supported function on Windows. Share API is not available in this browser on macOS.`

When using Standalone Chrome and enabling the Web Share as per the below:

![image](https://github.com/capacitor-community/electron/assets/23147783/89040ada-fb93-4cbc-8099-dbe9ca8291d5)

It works as expected.

When disabling it in the browser, I receive `navigator.share() is not a supported function on Windows. Share API is not available in this browser on macOS.` as in the Electron app.

**Describe the solution you'd like**
In normal Electron, using `app.commandLine.appendSwitch('enable-features', 'WebShare');` should suffice to enable the Web-share functionality.

**Describe alternatives you've considered**
I have tried adding `app.commandLine.appendSwitch('enable-features', 'WebShare');` in different areas of the setup.ts to no avail. The Share API is still not available in the Electron app.

I have also tried adding `experimentalFeatures: true,` in the new BrowserWindow() function, but this has not changed the result.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.