Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Add REST API support for being a compatible SingleFile Destination #980

Open
tjofle opened this issue Feb 3, 2025 · 2 comments

Comments

@tjofle
Copy link

tjofle commented Feb 3, 2025

Motivation
Some websites can't be preserved from a headless server due to Captcha walls, Login walls, cookie banners etc.
These websites are properly preserved when using the SingleFile extension in the browser.

SingleFile supports saving the preserved HTML file to a REST form API instead of saving to disk.
LinkDing already supports uploading files as attachments to links.

Request
It would also be nice if the LinkDing API had support as a SingleFile compatible Destination. SingleFile would post a request the API that will:

  1. Create a new bookmark entry
  2. Upload the attached file as a HTML snapshot for the new bookmark

See also Hoarder.app's recent implementation of this feature:
https://docs.hoarder.app/Guides/singlefile (REST API as Save Destination in SaveFile browser extension)

Image

Also related: #718 [Feature request] Bookmark Assets API

@sissbruecker
Copy link
Owner

I was thinking about this a bit. It's cool that the Singlefile extension supports posting its data to a REST API. However you would still want to add bookmarks through the linkding extension so that you could add tags, description and all the other data that you can set. If you would have to use the Singlefile extension to create bookmarks you'd lose all of that. And using the Singlefile extension "on demand" is bothersome too, as you don't necessarily know if the linkding server can save a page well or not.

It seems there might be a better way to do this. The Singlefile extension supports external message passing. That means any other extension, such as the linkding extension, can trigger saving a page. So the workflow could be something like this:

  • You configure the Singlefile extension with the linkding endpoint
  • You enable triggering Singlefile snapshots in the linkding extension options
  • On a page you want to bookmark you open the linkding extension and save a bookmark as usual
  • The linkding extension then triggers saving the page in the Singlefile extension
  • Singlefile does its thing, sends the results to the linkding server
  • The server already has the bookmark created by the linkding extension, and can just add the new snapshot to it

I gave it a quick try and communication between the extensions seems to work. Still, apart from adding the endpoint and triggering the Singlefile, this would require additional work in the extension to integrate this into the save bookmark workflow, providing an option for enabling the feature and ensuring that the linkding server actually runs at a version that has the new endpoint.

@huyz
Copy link

huyz commented Feb 20, 2025

@sissbruecker That workflow does sound much better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants