Skip to content

This is a sample of a TWA requesting clipboard access.

Notifications You must be signed in to change notification settings

GoodNotes/TWAClipboardSample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Sample TWA app to request clipboard permission

How to run the example

  1. How to launch the web app
  2. How to launch the Android app

Screenshot_1710265892

What is the problem?

Executing:

await navigator.clipboard.read();

returns a promise that is never resolved or rejected.

How to reproduce the problem?

  1. Start the web.
  2. Launch the Android app.
  3. Tap on the button.
  4. In the Chrome console, you can see the first log message but not the one after the promise and no dialogue prompts for permission in the TWA.

To reproduce it again you must clear site settings and permissions inside Google Chrome, kill the app and open it again.

Which version of Chrome are we using?

It happens with all the latest versions of Chrome. For example: chromeVersion

Example of permission dialogue never appearing

permissionDialogNeverShownInTWA.mp4

Example of permission being rejected briefly while reloading with Chrome dev tools

permissionDialogBrieflyAppearingAfterReloadWithDevTools.mp4

Example of correct behaviour in Chrome outside the TWA

workingFineInChrome.mp4

It also happens with other permissions, like the microphone

microphoneNotWorking.mp4

About

This is a sample of a TWA requesting clipboard access.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published