vue-use-web
vue-use-web copied to clipboard
Script feedback
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.
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.
It would be my pleasure.