StreamSaver.js icon indicating copy to clipboard operation
StreamSaver.js copied to clipboard

Using StreamSaver in a userscript

Open Zipdox opened this issue 2 years ago • 6 comments

What would be the best way of using StreamSaver to progressively download a file from a userscript?

Zipdox avatar Feb 23 '22 12:02 Zipdox

what is a userscript?

if it's chromium specific then i would recommend using whatwg/fs directly instead instead of using StreamSaver.js

jimmywarting avatar Feb 23 '22 12:02 jimmywarting

what is a userscript?

https://en.wikipedia.org/wiki/Userscript

if it's chromium specific then i would recommend using whatwg/fs directly instead instead of using StreamSaver.js

No it's browser agnostic.

Zipdox avatar Feb 23 '22 12:02 Zipdox

When I tried creating a script that uses StreamSaver inside Greasemonkey, I was getting an error, but the same script worked with Violentmonkey without any extra complications.

FreeFull avatar May 07 '22 01:05 FreeFull

I'm getting this error:

Failed to get service worker registration(s): Storage access is restricted in this context due to user settings or private browsing mode.

What did you do to get it working? I'm using ViolentMonkey

Zipdox avatar Jun 20 '22 17:06 Zipdox

@Zipdox I haven't tried using the userscript from Private Browsing, so I'm not sure what it'd take to have that work. It did work for me without Private Browsing though.

FreeFull avatar Jun 20 '22 22:06 FreeFull

I haven't tried using the userscript from Private Browsing, so I'm not sure what it'd take to have that work. It did work for me without Private Browsing though.

I'm not using private browsing though. This is a normal tab on an HTTPS page. Would you mind sharing your working code?

Zipdox avatar Jun 20 '22 23:06 Zipdox