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 a bookmarklet to add a page to shiori directly by cliking on a bookmarklet on a given page. #84

Closed
gissehel opened this issue Apr 9, 2018 · 9 comments

Comments

@gissehel
Copy link
Contributor

gissehel commented Apr 9, 2018

Add a bookmarklet to add a page to shiori directly by cliking on a bookmarklet on a given page.

Expected usage

  • On the shiori main page, there would be a link named "Add" or "Add to shiori" that would link to an addresse like javascript:(function(){...})()
  • By drag & dropping the link the bookmark bar, the user would "install" the bookmarklet
  • When browsing a web site (eg: www.google.com), the user would click on the link "Add to shiori" that would then execute the javascript contained in the link.
  • The javascript would then insert the current page into the shiori server, using the currently logged user, with no title and no tag (or with a #to_sort tag)
@RadhiFadlillah
Copy link
Collaborator

Hi guys, sorry for late response.

I've made a simple bookmarklet for shiori that works by sending POST request to $SHIORI/api/bookmarks through XMLHttpRequest. The problem is this only works if $SHIORI is HTTPs, because the modern web browser now blocks all active mixed content.

Now, since shiori is self hosted, not all user can serve it behind HTTPs. To solve it, as the fallback when $SHIORI is not HTTPs, I'm planning to make the bookmarklet redirects user to submit page $SHIORI/submit?url=... (just like Reddit's submit page).

If all goes well this feature should be committed on these following days.

@5hay
Copy link

5hay commented Jun 5, 2018

Since you can get a SSL certificate pretty easily and for free through LetsEncrypt, you could maybe integrate auto certificate renewal.

https://godoc.org/golang.org/x/crypto/acme/autocert as a reference.

I think most shiori instances are available over the internet, that's why I would definitely recommend a SSL certificate.

@RadhiFadlillah
Copy link
Collaborator

I've added bookmarklet in commit 4b93937. To use it, just drag the Add new bookmark button to your bookmark toolbar :

Screencast

When possible (i.e. allowed by CSP), the bookmarklet will show dialog for saving new bookmark :

As dialog

However, if it's not possible, the bookmarklet will redirect you to submit page :

As submit page

Please try it out.


Since you can get a SSL certificate pretty easily and for free through LetsEncrypt, you could maybe integrate auto certificate renewal...

I don't think I will do it, because :

  • It adds new complexity to shiori. Right now I just want to focus on making shiori stable and reliable enough to use.
  • When user self hosted shiori, they usually put it behind a web server anyway, and there are already many good web server that can fetch SSL certificate from Let'sEncrypt, e.g Caddy and nginx.

@5hay
Copy link

5hay commented Jun 6, 2018

Works pretty nice, running behind a Nginx reverse proxy on my Raspberry Pi via Docker. Thank you!

@gissehel
Copy link
Contributor Author

As it works fine, I'll close the issue.

@imjoeyli
Copy link

It doesn't work now? The add button can't drag and drop.

@jajpater
Copy link

Doesn't work here either

@8bitgentleman
Copy link

The bookmarklet has been depreciated and the official method is now the web extension

@jajpater
Copy link

@8bitgentleman I know, but that didn't work for me either see this issue

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

6 participants