title: Clipboard API call throws NotAllowedError without invoking onPermissionRequest()
body: <p>I have a simple page with a button, that when pressed, uses the Async Clipboard API to write to the clipboard.</p>
  <pre class="lang-html prettyprint-override"><code>&lt;body&gt;
    &lt;button type=&quot;button&quot; onclick=&quot;testClipboard();&quot;&gt;
      Test Clipboard
    &lt;/button&gt;
  &lt;/body&gt;
  </code></pre>
  <pre class="lang-js prettyprint-override"><code>function testClipboard() {
    navigator.clipboard.writeText(&quot;Clipboard API Test&quot;).then(
      v =&gt; alert(&quot;Success&quot;),
      e =&gt; alert(&quot;Fail\n&quot; + e));
  }
  </code></pre>
  <p>This works on both Chrome and Firefox, desktop and mobile. However on Android Webview it throws the following error:</p>
  <p><code>NotAllowError: Write permission denied.</code></p>
  <hr />
  <p>I figured I need to override <code>WebChromeClient.onPermissionRequest()</code> to grant the permission, but strangely <code>onPermissionRequest()</code> does not seem to have been invoked, and the same error is still thrown.</p>
  <pre class="lang-java prettyprint-override"><code>public class WebChromeController extends WebChromeClient {
    @Override
    public void onPermissionRequest(PermissionRequest request) {
      Log.d(&quot;myTag&quot;, &quot;Permission request&quot;);
      Log.d(&quot;myTag&quot;, request.getResources().toString());
      request.grant(request.getResources());
    }
  }
  protected void initWebView() {
    // ...
    myWebView.setWebChromeClient(new WebChromeController());
  }
  </code></pre>
  <p>I still get the same error:</p>
  <p><code>NotAllowError: Write permission denied.</code></p>
  <p>Also Logcat logged nothing.</p>
  <hr />
  <p>I suspected maybe my Android App requires additional permissions to access the clipboard, but according to <a href="https://developer.android.com/about/versions/10/privacy/changes#clipboard-data" rel="noreferrer">https://developer.android.com/about/versions/10/privacy/changes#clipboard-data</a>, my App should have permission when it has focus. Indeed, the following code works:</p>
  <pre class="lang-java prettyprint-override"><code>ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
  ClipData clip = ClipData.newPlainText(&quot;MyLbl&quot;, &quot;I have permission&quot;);
  clipboard.setPrimaryClip(clip);
  </code></pre>
  <p>I also declared the following in <code>AndroidManifest.xml</code> in case the action of requesting permission requires permission:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;uses-permission android:name=&quot;android.webkit.PermissionRequest&quot; /&gt;
  </code></pre>
  <p>This did nothing.</p>
  <p>So it is probably not an issue with App level permission.</p>
  <hr />
  <p>What is happening?</p>
  <p>How can I get Async Clipboard API calls to work in Webview?</p>
  <hr />
  <p>OS: Android 10 Q</p>
  <p>Webview: v. 81.0.4044.111</p>