marabesi / json-tool

json-tool allows you to quick format json content with a click of a button.
https://json.marabesi.com
Creative Commons Zero v1.0 Universal
6 stars 2 forks source link

improve feedback for copy/paste when api is not available #34

Closed marabesi closed 1 year ago

marabesi commented 1 year ago

Describe the bug

When using the tool on firefox, the button "Paste from clipboard" and "copy json" do not work.

Uppon a closer inspection, it seems that firefox does not support the clipboard api, it shows the following error:

Uncaught (in promise) TypeError: navigator.clipboard.read is not a function
    e Editors.tsx:84
    Babel 7
    F Editors.tsx:83
    React 11
    unstable_runWithPriority scheduler.production.min.js:18
    React 3
Editors.tsx:84:53

To Reproduce Steps to reproduce the behavior:

  1. Go to 'https://marabesi.github.io/json-tool/' with firefox
  2. Open dev tools (ctrl + shift + i)
  3. Select the tab "Console"
  4. Click on "Paste from clipboard"
  5. See error

Expected behavior

marabesi commented 1 year ago

refs e4a40ed78c76f49ccfc26f12f72b0816b5ead020 7310ad944d95b8dd225d34bf7080f33f3859275b