web icon indicating copy to clipboard operation
web copied to clipboard

Allow extensions to announce contentType to AppWrapper, make saving images possible

Open pascalwengerter opened this issue 1 year ago • 5 comments

Description

Necessary for https://github.com/owncloud/web-extensions/pull/43

pascalwengerter avatar Sep 19 '24 12:09 pascalwengerter

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

update-docs[bot] avatar Sep 19 '24 12:09 update-docs[bot]

Ah, it's the other way round - the extension needs to tell the mimetype to oC Web because we are only creating a new file?

dschmidt avatar Sep 20 '24 09:09 dschmidt

Ah, it's the other way round - the extension needs to tell the mimetype to oC Web because we are only creating a new file?

No, it's updating an existing file

pascalwengerter avatar Sep 20 '24 09:09 pascalwengerter

Why do we need this? Can't the extension just use resource.mimeType directly?

I would like to keep the api surface minimal

Open for suggestions regarding the approach. We could check the resource.mimeType (for jpeg/png), but then it's an implicat thing happening in the AppWrapper rathern than the application announcing what it wants to do (albeit the naming/API isn't ideal yet)

pascalwengerter avatar Sep 20 '24 09:09 pascalwengerter

@dschmidt do you have a better suggestion with regards to API design? Or @JammingBen maybe?

pascalwengerter avatar Oct 31 '24 17:10 pascalwengerter

Hmmm, I can't really think of a non-ugly solution here. You could give apps the possibility to define a custom save task and call that if given. Though it would be a lot of code duplication in this specific case... so I guess I'm fine with this approach. Maybe add a comment to the AppWrapper property to explain how this is used?

JammingBen avatar Nov 05 '24 08:11 JammingBen

The image editor extension PR is closed -> closing this one as well

LukasHirt avatar Apr 29 '25 09:04 LukasHirt