1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31

content / test / data / android / webshare-long.html [blame]

<!DOCTYPE html>
<html>
    <head>
        <title>Web Share</title>
        <script>
            function initiate_share() {
                if (navigator.share === undefined) {
                    window.document.title = 'Fail: navigator.share === undefined';
                    return;
                }

                const kMaxTextLength = 120 * 1024;
                var data = {
                    text: 'y'.repeat(kMaxTextLength + 1)
                };
                navigator.share(data).then(() => {
                    window.document.title = 'Success';
                }).catch(e => {
                    window.document.title = 'Fail: ' + e;
                });
            }

            window.addEventListener('load', () => {
                window.addEventListener('click', initiate_share);
            });
        </script>
    </head>
    <body>
        WebShare Test!
    </body>
</html>