discoveryjs / discovery

A framework for rapid data (JSON) analysis, shareable serverless reports and dashboards
https://discoveryjs.github.io/discovery/
MIT License
331 stars 6 forks source link

struct view issues #90

Closed FeltBoots closed 2 years ago

FeltBoots commented 2 years ago

Hi! I faced a problem with a copyText action inside struct view while building web extension based on discoveryjs that's supposed to work inside devtools .

My project's discovery version is: "@discoveryjs/discovery": "^1.0.0-beta.64"

I got this Uncaught (in promise) NotAllowedError: The Clipboard API has been blocked because of a permissions policy applied to the current document.. That check https://github.com/discoveryjs/discovery/blob/master/src/core/utils/copy-text.js#L40 does not seem to work in my context ie devtools iframes.

What I tried:

  1. Adding locally additional check window.isSecureContext but no luck
  2. Removing check and leaving only fallback solution https://github.com/discoveryjs/discovery/blob/master/src/core/utils/copy-text.js#L18 -- it works. But I can't do it with my build, only locally testing.

I could copy all struct view only changing that actions but I don't think that's a good idea.

I need that functionality a lot. I think it would be great to be able to configure actions inside that view. A copy action at least. Need something to make it work.

Thank you.