nyxt icon indicating copy to clipboard operation
nyxt copied to clipboard

Don't download unnecessary/junk resources

Open aartaka opened this issue 2 years ago • 5 comments

In 08af7661bc90bd8e4518a56bbcca4e9aa2bddd73, I've reverted the change that was relying on the toplevel-ness of the request to decide whether to download the requested file. This was because some of the page resources, like iframe contents, scripts, or opaque data formats, were mistakenly recognized for downloads. And mistakenly taking something for download means computer filesystem and network bandwidth sacrifice, let alone the confusion caused by (possibly unwelcome) files appearing out of nowhere.

The toplevel-ness is not a solid marker of the person's willingness to download the thing (as per #2237). What is, then? Firefox prompts the user for what to do with the file, which might be a good reference for download interface. But then, Firefox also seems to somehow throw away all these junk resource downloads that we ocasionally have. How?

aartaka avatar Jun 16 '22 09:06 aartaka

I've been having a bunch of empty files in my ~/Downloads directory, I suppose this is issue right? Downloaded files include aniview cookiesyncendpoint pixelSync occ. Maybe one way to filter them out would be to check the size, since they are all empty, for whatever reason.

@aartaka Do you have a recipe?

Ambrevar avatar Jul 12 '22 18:07 Ambrevar

I've been having a bunch of empty files in my ~/Downloads directory, I suppose this is issue right? Downloaded files include aniview cookiesyncendpoint pixelSync occ. Maybe one way to filter them out would be to check the size, since they are all empty, for whatever reason.

A better way: prompt before downloading the file, like all the other browsers do :D We have suggested name available, we have all the meta-data for the person to make the decision on whether they want this or that file...

@aartaka Do you have a recipe?

Open any JSTOR page :D

aartaka avatar Jul 13 '22 10:07 aartaka

A better way: prompt before downloading the file, like all the other browsers do :D We have suggested name available, we have all the meta-data for the person to make the decision on whether they want this or that file...

Isn't it going to be very annoying to browse pages like JSTOR then? The user would be constantly prompted... :'(

Ambrevar avatar Jul 13 '22 16:07 Ambrevar

That's why I've done 83629e4353fc7d4c1cf2326ae997156a698153c2 -- to reduce the number of false positives. But then it introduced some false negatives too :D

Still, prompting is better than uncontrollable downloads...

aartaka avatar Jul 13 '22 18:07 aartaka

Like I previously mentioned, a workaround beside prompting is the check the download size: if it's 0, drop it.

Ambrevar avatar Jul 18 '22 11:07 Ambrevar