navigator.share 无法在移动浏览器中使用(chrome v64)

navigator.share not working in mobile browser(chrome v64)

我一直在尝试使用 navigator.share.

从 javascript 在 Android 浏览器中触发 Intent Share

示例代码如下:

$("#printTest").click(function(e){
    if (navigator.share === undefined){
        alert('Undefined!');
    }
    else{
        alert('Sharing!');
        navigator.share({title: 'Example Page', text: 'https://example.com'});
    }
});

当我尝试在 ubuntu 中单击来自 chrome 的按钮时,它会打开一个 window 用于共享(虽然没有显示 select 的应用程序)。但同样不适用于任何 android 移动浏览器。我在 Chrome 中测试了 Android 版本 64,在 Chrome 中测试了 Android Dev。即使在启用标志 chrome://flags/#enable-experimental-web-platform-features.

之后,所有显示警报 'Undefined'

navigator.share 仅适用于 https 而不是 HTTP

的网站