navigator.share

91 views
Skip to first unread message

Simon Dalton

unread,
Sep 27, 2025, 2:56:43 PMSep 27
to DroidScript
Hi,

Would it be possible to use navigator.share in a HTML app?

The following code works OK in Chrome but not from a DS App.

Thanks,
Simon.

<html>
<head>
    <meta name="viewport" content="width=device-width">
    <script src="ds:/Sys/app.js"></script>
</head>

<script>
    //Called after application is started.
    function OnStart()
    {
       
    }
   
    function share()  {
    if (navigator.share)    {
        navigator.share({
        title: 'My Website',
        url: 'https://www.abc123.com'
    })
          } else
         
          {console.log("Share is not supported!")};
   
   
   
}
</script>

<style>
body { background-color: #ffffff; }
   
</style>

<body onload="app.Start()">

<button id="share_button" onClick='share();'>SHARE ME!</button>

</body>
</html>

Cemal

unread,
Sep 28, 2025, 3:57:37 AMSep 28
to DroidScript
Hi,
Unfortunately, this feature does not work in Android WebView. 

You can try using the SendText function:

Simon Dalton

unread,
Sep 29, 2025, 1:40:43 PMSep 29
to DroidScript
OK that's a shame.

I've used sendtext instead, thankyou for the tip.

Dave

unread,
Oct 1, 2025, 4:07:18 AMOct 1
to DroidScript
I think we could add this feature as it would be very useful for Hybrid cross-platform apps.

ChatGPT says it can be implemented using the java bridge on Android.... I'll put it on the high priority 'todo' list for V3
Reply all
Reply to author
Forward
0 new messages