vue-use-web icon indicating copy to clipboard operation
vue-use-web copied to clipboard

Script feedback

Open ghost opened this issue 6 years ago • 2 comments

I see you're using the Script DOM Element approach to script tag injection in the Script example. While that's good and well it feels a bit kludgy given Fetch hasn't implemented yet and, using Fetch, you could handle a more general use case covering both Script and Styles with additional control and without the need to promisfy the synchronous code written.

Given many of the other APIs exposed in this project are highly UA dependent (e.g. Battery Status) and likely to be unreliable – surprisingly given the website suggests "graceful degradation" and I can't use the clipboard on known working devices – please consider reworking Script to use Fetch Injection to support Style injection in addition to adding extensibility using modern standards under a more declarative approach. Cheers.

ghost avatar Oct 08 '19 12:10 ghost

Thanks for the suggestion, would you be interested in PRing this?

surprisingly given the website suggests "graceful degradation"

Well, this is still in the early stages, some APIs might need some alternatives or polyfills, but "graceful degradation" is a goal of this library.

logaretm avatar Oct 08 '19 21:10 logaretm

It would be my pleasure.

ghost avatar Oct 09 '19 04:10 ghost