Closed BHznJNs closed 2 months ago
It seems that only need to try invoke navigator.clipboard.writeText(content)
and judge whether there is any errors.
I think there may be no need to judge permissionStatus
and browser type.
It seems that only need to try invoke
navigator.clipboard.writeText(content)
and judge whether there is any errors.I think there may be no need to judge
permissionStatus
and browser type.
In some Chromium based browser, e.g. Microsoft Edge in the picture below, there is permission settings for websites and these settings are just corresponds to the PermissionName for Chromium. Thus I infer that there is still need to check the browser and user permission?
I tried the isChromium function and found that it returns false under Chrome 124.0.6367.119.
just use await navigator.clipboard.writeText
should be nice in both firefox and chomium.
LGTM
As I reported in this issue #542 , the
Copy to Clipboard
in the Code Export dislog causes a JavaScript error. The reason of this error was also mentioned in this issue and what I did is just to check the browser the user uses. For the Chromium based browser, just copy as the original way while for the Firefox and Webkit browser, directly calls thenavigator.clipboard.writeText
function.