Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.8K
Views
copy to clipboard using navigator.clipboard.writetext not working in android WebView

I have a simple android WebView application which is displaying a website featuring 'copy' buttons using the following code:-

navigator.clipboard.writeText('Text to be copied')
  .then(() => {
    console.log('Text copied to clipboard');
  })
  .catch(err => {
    // This can happen if the user denies clipboard permissions:
    console.error('Could not copy text: ', err);
  });

this is working in all desktop and mobile browsers and an iOS WebView application however I cant it fails and catches the following error within a android WebView application: DOMException: write permission denied.

these are the settings for the WebView within the app:

    webView.settings.javaScriptEnabled = true
    webView.settings.userAgentString = "EngageMobileApp Android"
    webView.settings.builtInZoomControls = true
    webView.settings.displayZoomControls = false
    webView.settings.allowFileAccess = true
    webView.settings.setAppCacheEnabled(true)
    webView.settings.domStorageEnabled = true
    webView.settings.loadWithOverviewMode = true
    webView.settings.allowContentAccess = true
    webView.settings.mediaPlaybackRequiresUserGesture = false
    webView.settings.javaScriptCanOpenWindowsAutomatically = true
    WebView.setWebContentsDebuggingEnabled(true)

and the set permissions within the manifest:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
over 4 years ago · Hanz Gallego
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!