Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Clipboard and DOMException: Write permission denied

Post Reply
Alexeich
Posts: 24
Joined: Fri May 29, 2020 12:15 pm

Clipboard and DOMException: Write permission denied

Post by Alexeich »

Hello. Could you please help with clipboard using.
The navigator.clipboard.writeText doesn't work (button on the site copying the text). I see the "DOMException: Write permission denied" error in the console. It doesn't works in miniBrowser demo too, but it works in the chrome, even 96.* version.
My chromium version is 97.0.4692-2.99.
User avatar
salvadordf
Posts: 4620
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Clipboard and DOMException: Write permission denied

Post by salvadordf »

Hi,

Use the TChromiumCore.OnShowPermissionPrompt event to grant permission.

Code: Select all

      /// <summary>
      /// <para>Called when a page should show a permission prompt. |prompt_id| uniquely
      /// identifies the prompt. |requesting_origin| is the URL origin requesting
      /// permission. |requested_permissions| is a combination of values from
      /// TCefPermissionRequestTypes that represent the requested permissions.</para>
      /// <para>Return true (1) and call ICefPermissionPromptCallback.Continue either
      /// in this function or at a later time to continue or cancel the request.</para>
      /// <para>Return false (0) to proceed with default handling. With the Chrome
      /// runtime, default handling will display the permission prompt UI. With the
      /// Alloy runtime, default handling is CEF_PERMISSION_RESULT_IGNORE.</para>
      /// </summary>
      /// <remarks>
      /// <para>This event will be called on the browser process CEF UI thread.</para>
      /// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_permission_handler_capi.h">CEF source file: /include/capi/cef_permission_handler_capi.h (cef_permission_handler_t)</see></para>
      /// </remarks>
requested_permissions should get any of these values :
https://github.com/salvadordf/CEF4Delphi/blob/110fefdfb5999b990f6b094616a7efa88ef9e4fc/source/uCEFConstants.pas#L2111
Alexeich
Posts: 24
Joined: Fri May 29, 2020 12:15 pm

Re: Clipboard and DOMException: Write permission denied

Post by Alexeich »

salvadordf wrote: Tue Jun 11, 2024 3:59 pm Use the TChromiumCore.OnShowPermissionPrompt event to grant permission.
Thank you. Looks like update my chromium to 6478 branch was enough to fix the issue.
Post Reply