Re: [dev] [surf] [patch] Optionally handle downloads through webkit.

From: Arturo Espinosa <arturoea_AT_gmail.com>
Date: Fri, 23 Mar 2018 10:16:15 -0600

Great. Quentin, could I take a look at your patch? It's probably
better than what I sent.

Yeah, the current surf approach is not ideal because it actually hits
the server twice, and it may also not work for downloads where the
resource is generated dynamically and change from one request to the
other for some reason. I just don't think it is correct for the
browser to assume that whatever is being downloaded won't change from
request to request.

I'm happy that the patch at least brought up the discussion.


On Fri, Mar 23, 2018 at 3:01 AM, Quentin Rameau <quinq_AT_fifth.space> wrote:
>> Hi.
>
> Hello Arturo,
>
>> First of all, thank you for surf. It's a great, minimalistic shell for
>> webkit, and it has proven of great value for our current project. Big
>> thumbs up for that, thanks.
>
> Well, I'm glad you find it useful!
>
>> We are working on a POS system and using surf as part of our
>> kiosk-like solution.
>
> Good, some other people do too.
>
>> Part of our system requires to be able to save a Blob to the local
>> filesystem, to export CSV files and such. You can check this kind of
>> functionality here:
>>
>> https://datatables.net/extensions/buttons/examples/initialisation/export
>>
>> The problem is that with the way surf currently handles downloads, it
>> is not possible to handle Blob URIs, since these are resources that
>> are only accessible through the web component's internal state.
>>
>> Our current solution is to disable curl spawning within surf's code,
>> and let webkit handle the download silently. This is an adequate
>> solution for us, and we are sending you a small patch that enables
>> this functionality as a command-line option.
>>
>> You can check the pull request here:
>>
>> https://patch-diff.githubusercontent.com/raw/pupitetris/suckless-surf/pull/1
>>
>> And get the patch/diff here:
>>
>> https://patch-diff.githubusercontent.com/raw/pupitetris/suckless-surf/pull/1.patch
>> https://patch-diff.githubusercontent.com/raw/pupitetris/suckless-surf/pull/1.diff
>>
>> I hope you find this modification adequate.
>
> Thank you for sharing your work on it.
>
> I've been keeping a patch locally letting WebKit handle downloads for a
> year or so but have been too lazy to push it yet…
>
> The main issue besides blob, is that some websites will establish an
> extra session for the download or some sort and this won't be reflected
> in the cookie file and the external user agent will be refused to
> access the link.
>
> Thank you for motivating me a little, I will push it on the wiki, maybe
> you'll like it too!
>
Received on Fri Mar 23 2018 - 17:16:15 CET

This archive was generated by hypermail 2.3.0 : Fri Mar 23 2018 - 17:24:19 CET